jquery, mouseover/out 정보
jQuery jquery, mouseover/out본문
$(function() { $('img[data-hover]').hover(function() { $(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp'); }).each(function() { $('<img />').attr('src', $(this).attr('data-hover')); });; }); |
다음 처럼 사용 하시면 되구요
<img src="first.gif" data-hover="second.gif" /> |
추천
0
0
댓글 0개