Posted By

damarev on 11/24/11


Tagged

jquery


Versions (?)

jquery image rollover with style!


 / Published in: jQuery
 

Usage:

  1. $(function() {
  2. $('img[data-hover]').hover(function() {
  3. $(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
  4. }).each(function() {
  5. $('<img />').attr('src', $(this).attr('data-hover'));
  6. });
  7. });

Report this snippet  

You need to login to post a comment.