Skip to content

Instantly share code, notes, and snippets.

@megantaylor
Created July 18, 2014 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save megantaylor/383a430dc16bcdc9d1a0 to your computer and use it in GitHub Desktop.
Save megantaylor/383a430dc16bcdc9d1a0 to your computer and use it in GitHub Desktop.
Fade in/fade out on hover. The code below set opacity to 100% on hover, and to 60% on hover.
$(document).ready(function(){
$(".thumbs img").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads
$(".thumbs img").hover(function(){
$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
},function(){
$(this).fadeTo("slow", 0.6); // This should set the opacity back to 60% on mouseout
});
});
//http://snipplr.com/view/18606/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment