【发布时间】:2010-12-24 18:41:32
【问题描述】:
我正在使用 jquery,我想要在这里做的是能够设置将根据悬停的链接显示的图像。
<script type='text/javascript'>
$(function(){
$('img').hide();
$('a').mouseenter(function(){
var currentimg= $(this).html();
alert(currentimg);
$("img[src=currentimg.jpg]").show(); //I want to use currentimg variable here for the name of the jpg file
});
$('a').mouseleave(function(){
$('img').hide();
});
});
</script>
【问题讨论】:
标签: javascript jquery html image