【发布时间】:2012-11-08 02:01:55
【问题描述】:
$(function(){
$("#top-img").hover(function(){
$(this).stop().animate({height:"400px"},{queue:false,duration:700});
},
function() {
$(this).stop().animate({height:"300px"},{queue:false,duration:700});
});
});
这是我正在使用的代码,大部分都很简单。当我将鼠标悬停在 div #top-img 上时,它会从 300px 的高度(在 CSS 中设置)将其设置为动画到 400px 的高度。
我想稍微延迟一下,以便
- 人们必须在它运行前将鼠标悬停一秒钟,然后
- 您必须先离开它一秒钟,然后它才能返回
300px。
【问题讨论】:
标签: hover jquery-animate delay