December 12, 200916 yr Hi all, I've decided to not use jQuery plugins and build my own gallery for my site. To choose a picture there is a set of thumbnails, I want them all to have 0.5 opacity, then you hover over them they go up to 1.0. So far I have this: $("#thumbnail-rack img").fadeTo(300, 0.5); // Sets opacity to 0.5 $('#thumbnail-rack img').hover(function(){ $('#thumbnail-rack img').fadeTo(300, 1.0); // Sets the opacity to 100% on hover }, function(){ $('#thumbnail-rack img').fadeTo(300, 0.5); // Sets the opacity back to 50% on mouseout }); ..which works but it works on all the images at the same time, not just the one being hovered over. The images do have their own ID's, so I could call it individually, but I'm sure there's a better way.
December 12, 200916 yr $("#thumbnail-rack img").fadeTo(300, 0.5); // Sets opacity to 0.5 $('#thumbnail-rack img').hover(function(){ $(this).fadeTo(300, 1.0); // Sets the opacity to 100% on hover }, function(){ $(this).fadeTo(300, 0.5); // Sets the opacity back to 50% on mouseout });
Create an account or sign in to comment