jQuery 绑定 mouseenter &鼠标离开摆动问题
我想问是否有适当的方法来避免“mouseenter mouseleave”功能对所选元素的摆动?
这段代码来自jquery,它工作正常,但是当您错误地将鼠标悬停在导航上多次时,当您的鼠标已经位于该元素上时,它会摆动隐藏的元素。
$('#mn_learn').bind('mouseenter mouseleave', function(){
$('.toggleLearn').slideToggle('250');
});
我确实尝试过检查如何避免这种情况,但我并不幸运这样做。预先感谢您的帮助。 在此处查看示例...
I'd like to ask if there's a proper way of avoiding 'mouseenter mouseleave' function for/to wobble the element selected?
this code came from jquery and it is working properly but when you hover mistakenly many times the navigation, it wobble the hidden elements when your mouse is already over to the element.
$('#mn_learn').bind('mouseenter mouseleave', function(){
$('.toggleLearn').slideToggle('250');
});
i did tried to check on how to avoid that but im not lucky to do that. advance thanks for the help.
check the sample here...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jQuery 对您尝试执行的每个动画进行排队,以免错误地同时运行两个动画,为了防止动画过载,您需要使用
jQuery.stop(1,1)< 清除当前对象的队列/代码>。
jQuery queues every animation that you are attempting to do in order to not mistakenly run two at the same time, in order to prevent animation overload, you need to clear the current object's queue using
jQuery.stop(1,1)
.