<script type="text/javascript">
$(function() {
$("#lnb_sub_sup_menu li a img").hover(function(){
$(this).attr("src", $(this).attr("src").replace("_off.gif", "_on.gif"));
}, function(){
$(this).attr("src", $(this).attr("src").replace("_on.gif", "_off.gif"));
});
});
</script>
<a href="#"><img src="img/abc01_on.gif" class="image_rollover" /></a>
이렇게 소스를 짜보았는데
on 이미지에서 off으로 넘어가지지가 않네용;;
답변 2개 / 댓글 2개
<a href="#"><img src="img/abc01_on.gif" id='menu_01' class="image_rollover" /></a>
$('img[id^=menu_]').mouseover(function(){
var num = $(this).attr("id").split('_');
$(this).attr("src", "img/abc"+num[1]+"_on.gif");
}).mouseout(function(){
var num = $(this).attr("id").split('_');
$(this).attr("src", "img/abc"+num[1]+"_off.gif");
});
요렇게 해보세요
답변에 대한 댓글 1개
<script type="text/javascript">
$(function() {
$("#lnb_sub_sup_menu li a img").hover(function(){
$(this).attr("src", $(this).attr("src").replace("_on.gif", "_off.gif"));
}, function(){
$(this).attr("src", $(this).attr("src").replace("_off.gif", "_on.gif"));
});
});
</script>
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.