css - cufon hover 在鼠标离开后保持悬停状态。

标签 css hover cufon

我相信这可能是用户在 cufon 中使用悬停时面临的最常见问题之一。此外,可能有很多解决方案,但我已经尝试过但无济于事。请帮我。我遇到问题的网站是 [[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 的尝试。悬停仍然不起作用。还有其他解决方案还是我遗漏了什么?

最佳答案

您正在选择每个 .menubar a 而不是仅选择悬停的那个。试试这个:(双关语)

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 (注意) .

关于css - cufon hover 在鼠标离开后保持悬停状态。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8723023/

相关文章:

css - 链接重叠问题

html - 用省略号截断 <a> 中的字符串,但最后保留 img - 没有 JS

jquery - Cufon 文本覆盖 Fancybox

html - 如何定位一个 div 而不是里面的文本?

html - 是否有 WYSIWYG 编辑器可以在编辑期间呈现内联和链接样式表?

javascript - 单击时按钮消失

html - 将鼠标悬停在 anchor 标记内的图像上并且 anchor 标记位于 div 内时,如何显示文本?

html - 使用 css 缩放图像

font-face - 使用 @font-face 或 cufon 比使用图像更好吗?

javascript - cufon 不工作