This was a fun one to play with.
I think this is the effect you're after...

Demo:
http://jsbin.com/iwile
Source:
http://jsbin.com/iwile/edit

It's pretty concise & self-explanatory, but if you have any questions, just
reply.


SEAN O
http://www.sean-o.com
http://twitter.com/seanodotcom



ixxalnxxi wrote:
> 
> I'm trying to set up a gallery on my own (similar to galleria) so I can
> get my hands dirty with jquery. 
> 
> I have a set of images that either have the class "inactive" or "active"
> attached to them. When I leave all my images with the "inactive" class by
> default, everything works fine but it looks terrible because the image div
> is empty and all thumbnails have .33 opacity. 
> 
> Now, when I set an image to "active", it correctly shows up with an 100
> opacity thumbnail and a filled in image div once i click on another
> thumbnail then move back to the thumbnail that was once by default active,
> it doesn't function correct. 
> 
> html,
> 
>       <td>
>                        images/01_nintendoDSa.gif 
>       </td>
>       
>       <td>
>                        images/02_nintendoDSb.gif 
>       </td>
>       
>       <td>
>                        images/03_colourkeys.gif 
>       </td>
> 
> 
> 
> 
> 
> Then the jquery is as follows,
> 
>               $("img.inactive").click(function() 
>               {
>                       var image = $("img.active");
>                       if(image != $(this))
>                       {
>                               image.removeClass("active");
>                               image.addClass("inactive");
>                               image.fadeTo("slow", 0.33);
>                               $(this).removeClass("inactive");
>                               $(this).addClass("active");
>                               $(this).fadeTo("slow", 100);
>                       }
>               });
> 
> 
> Any suggestions?
> 

-- 
View this message in context: 
http://www.nabble.com/Newbie-needs-Help-with-jquery-logic-tp22257353s27240p22281961.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to