firefox中的slidedown和slideup循环错误 [英] slidedown and slideup looping bug in firefox

查看:93
本文介绍了firefox中的slidedown和slideup循环错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http: //www.queness.com/post/1047/easy-to-style-jquery-drop-down-menu-tutorial#comment-7912

我的菜单与阙上的菜单完全相同,因此请查看演示以查看问题。基本上,如果你正在使用firefox并且你的鼠标垂直向上和向下移动按钮,你可以获得滑动和滑动以在循环中闪烁。到处玩,你会发现这很容易。

I have a menu exactly like the one on queness, so check out the demo to see the issue. Basically, if you're using firefox and your mouse goes up and off the button vertically you can get the slidedown and slideup to sort of flicker in a loop. Play around and you'll see it's pretty easy to do.

有没有办法解决这个问题?出于某种原因,它只发生在firefox中。

Is there a way to fix this? For some reason it only happens in firefox.

谢谢

推荐答案

是的,你可以在JQuery中使用stop()函数,发生的事情是它可能正在排队。

Yeah you can use the stop() function in JQuery, whats happening is its probably queueing up.

http://api.jquery.com/stop/

$(document).ready(function () { 

$('#nav li').hover(
    function () {
        //show its submenu
        $('ul', this).stop(true,false).slideDown(100);

    }, 
    function () {
        //hide its submenu
        $('ul', this).stop(true,false).slideUp(100);         
    }
);
 });

这会阻止动画排队,检查stop()的参数以满足您的需求。

This stops the animation from queueing, check out the parameters of stop() to meet your needs.

编辑:

查看 http://css-tricks.com/examples/jQueryStop/

显示参数与Stop的区别。真的重新启动动画,这将使它看起来很奇怪。 True,false,允许动画完成,但会杀死队列。

Shows the difference in parameters with Stop. True true restarts the animation, which will make it seem glitchy. True , false, allows the animation to finish, but kills the queue.

这篇关于firefox中的slidedown和slideup循环错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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