【发布时间】:2013-02-27 05:23:57
【问题描述】:
我正在使用 mouseenter 和 mouseleave 制作动画,问题是如果我在 div 上快速移动鼠标,动画会变得疯狂,就像不停地重复,我该如何解决这个问题,任何一种停下来什么的?
这是我的代码:
/* Footer Hover */
function footerhover(){
var footer = $('#footer')
footer.bind({
'mouseenter' : function(){
footer_animate(200);
footer_bottom(145);
},
'mouseleave' : function(){
footer_bottom(0);
footer_animate(40);
}
})
}
function footer_animate(h){
$('#footer').animate({
height: h
}, 50 );
}
function footer_bottom(b){
$('#footer').animate({
bottom: b
}, 300 );
}
【问题讨论】:
标签: javascript jquery html