【发布时间】:2013-03-24 23:35:12
【问题描述】:
-
我希望我的 jquery 动画等到我的鼠标悬停/进入它大约 2 秒。否则,当我将图像放大时,事情会变得非常混乱。 2.这是我的代码,它使用jquery在执行mouseenter时使图像更大:
$('img').mouseenter(function(){ $(this).animate({ height: '+=40px', width: '+=40px' }); }); $('img').mouseleave(function() { $(this).animate({ height: '-=40px', width: '-=40px' }); });
【问题讨论】:
-
试试
.delay()函数api.jquery.com/delay
标签: jquery timeout jquery-animate wait mouseenter