본문 바로가기
FrameWork/jQuery

[JQUERY] 이미지 롤오버

by 백룡화검 2009. 11. 17.
http://www.selfcontained.us/2008/03/08/simple-jquery-image-rollover-script/


$(function() {
$('.rollover').hover(function() {
var currentImg = $(this).attr('src');
$(this).attr('src', $(this).attr('hover'));
$(this).attr('hover', currentImg);
}, function() {
var currentImg = $(this).attr('src');
$(this).attr('src', $(this).attr('hover'));
$(this).attr('hover', currentImg);
});
});


<img src="first.gif" hover="second.gif"  class="rollover"/>






ILSC 09-05-22 10:55
또다른 롤오버 스크립트<BR><A href="http://snook.ca/archives/javascript/jquery-bg-image-animations/"><BR>http://snook.ca/archives/javascript/jquery-bg-image-animations/</A>