取消所有排队的jQuery的效果基本show和动画了slideDown [英] Cancel all queued jQuery slideUp and slideDown animations

查看:379
本文介绍了取消所有排队的jQuery的效果基本show和动画了slideDown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大量使用jQuery的效果基本show和影响了slideDown扩大在三态样的方式项目的界面。

I have an interface that makes heavy use of the jQuery slideUp and slideDown effect to expand items in a tri-state kind of way.

onmouseover: function() { 
this.find('.details', this).slideDown(); 
},
onmouseout: function() { 
this.find('.details', this).slideUp(); 
}

然而,当用户快速移动鼠标在这些界面元素的动画跟不上和项目将被向下滑动和长后,鼠标已经离开了接口区。

However, when the user quickly moves the mouse over these interface elements the animations can't keep up and the items will be sliding up and down long after the mouse has left the interface area.

有没有办法取消所有排队的幻灯片动画当鼠标离开项目的容器div?

Is there a way to cancel all the queued-up slide animations when the mouse leaves the item's container div?

推荐答案

我相信你应该能够只需添加一个.stop(),它会照顾,对你:

I believe you should be able to just add a .stop() and it'll take care of that for you:

onmouseover: function() { 
this.find('.details', this).stop().slideDown(); 
},
onmouseout: function() { 
this.find('.details', this).stop().slideUp(); 
}

这篇关于取消所有排队的jQuery的效果基本show和动画了slideDown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆