【发布时间】:2010-12-02 05:32:29
【问题描述】:
我必须为单个mouseover 显示两个图像。因此,当我 mouseover 到图像时,首先显示图像,然后延迟 5000 次,需要为相同的悬停显示图像。现在在mouseout 上显示原始图像。
我对 JavaScript 和 jQuery 不太熟悉。
有人可以给我一些关于如何做到这一点的想法。
我所做的是,
$('.image1').mouseover(function() {
setInterval($(this).removeClass(.image1).addClass('image-over1'),5000);
$(this).removeClass(.image1).addClass('image-over2');
});
$('.image1').mouseout(function() {
$(this).removeClass('image-over1');
$(this).removeClass('image-over2').addClass(item);
});
$('.image1').click(function(){
document.location='index.php?page='index.php';
})
【问题讨论】:
-
如果您可以编辑您的问题并确保在源代码的所有位前放置 4 个空格...这样可以更容易理解您在做什么,因为这会使代码格式化程序为我们很好地展示。或者,突出显示代码位并单击编辑器中的 10101 图标。谢谢!
标签: javascript jquery mouseover setinterval mouseout