【问题标题】:cufon hover stays in hover state after mouse out.鼠标移出后,cufon hover 保持悬停状态。
【发布时间】:2012-01-04 06:40:43
【问题描述】:

我相信这可能是用户在 cufon 中使用 hover 时最常见的问题之一。此外,可能有大量的解决方案,但我试图无济于事。请帮我。我遇到问题的网站是 [[here]]

jQuery(document).ready(function(){
   jQuery('.menubar a').hover(function(){ 
       jQuery('menubar a').css('color','#000000'); 
       Cufon.refresh('menubar a'); 

    },function(){ // this is the mouse out 

       jQuery('menubar a').css('color','#707070'); 
       Cufon.refresh('menubar a'); 
   }); 
});

我还尝试了几次使用 Cufon.refresh() 刷新 cufon 的尝试。悬停仍然不起作用。还有其他解决方案还是我错过了什么?

【问题讨论】:

    标签: css hover cufon


    【解决方案1】:

    您选择每个 .menubar a,而不是只选择悬停的那个。试试this(双关语)

    jQuery(document).ready(function(){
       jQuery('.menubar a').hover(function(){ 
           jQuery(this).css('color','#000000'); 
           Cufon.refresh(this); 
        },function(){ // this is the mouse out 
           jQuery(this).css('color','#707070'); 
           Cufon.refresh(this); 
       }); 
    });
    

    不仅如此,你的几个选择器是menubar a,而它们应该是.menubar a (注意.

    【讨论】:

    • 天哪,谢谢 madmartigan。我没有注意到我自己的错误。 =/ 非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-15
    • 1970-01-01
    • 2011-05-26
    • 1970-01-01
    • 2011-09-02
    • 1970-01-01
    • 2013-11-26
    相关资源
    最近更新 更多