Jquery .hover函数淡入淡出问题

4

我在处理这个悬停效果时遇到了问题。 当内部的子菜单被点击时,整个菜单会淡出,然后再淡入。

$('.sc_menuwrap').hover(function(){
                $('.sc_menuwrap').stop().fadeTo("slow", 1.0); // This sets the opacity to 100% on hover
            },function(){
                $('.sc_menuwrap').stop().fadeTo("slow", 0); // This sets the opacity back to 60% on mouseout
            });

您可以在此处查看工作示例:http://dluxstudios.com/11。非常感谢您的任何帮助。
2个回答

1
$('.sc_menuwrap').hover(function(){
        $(this).stop().fadeTo("slow", 1.0);
        },function(){
        $(this).stop().fadeTo("slow", 0);
 });

试试这个,一定能行。


你只是在使用THIS对象,这与我对我的对象类名称的文字引用没有什么不同。但还是谢谢! - Sean Gallagher
最好让人们查看我的实际链接,这可能是个好主意。 - Sean Gallagher

0

请确保使用 stop(true, true)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接