Change Image Opacity on Hover


/ Published in: jQuery
Save to your folder(s)

In scripts.js


Copy this code and paste it in your HTML
  1. $(function() {
  2. $('a img').css("opacity","1.0"); //set initial opacity
  3. $('a img').hover(function() {
  4. $(this).stop().animate({ opacity: 0.75 }, "fast"); //on mouse hover
  5. },
  6. function() {
  7. $(this).stop().animate({ opacity: 1.0 }, "fast"); //on mouse out
  8. });
  9. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.