简体   繁体   English

Cufon鼠标悬停

[英]Cufon mouse-over

I have some HTML like this: 我有一些像这样的HTML:

<div class="button2" onclick="">
 <div class="button_text">LOCATE STORES</div>
 <div class="button_arrow"></div>
</div>

I use this code for Cufon: 我将此代码用于Cufon:

Cufon.replace('div.button2', { fontFamily: 'Bliss2H', hover: true, fontSize: '12px' });

My CSS: 我的CSS:

div.button2 {
  color: #d79645;
}
div.button2:hover {
  color: white!important;
}

Cufon works, however the text color does not change on mouse-over. Cufon工作,但文本颜色在鼠标悬停时不会改变。

For performance reasons :hover is not enabled by default, which means that you'll have to enable it separately for elements that need it. 出于性能原因:默认情况下不启用悬停,这意味着您必须单独为需要它的元素启用它。 You can do this with: 你可以这样做:

Cufon.replace('h1', {
    hover: true
});

https://github.com/sorccu/cufon/wiki/styling https://github.com/sorccu/cufon/wiki/styling

Your buttons are links? 你的按钮是链接? This is the CSS for what I've got going on this page: http://ianmartinphotography.com/test-site/ 这是我在这个页面上的CSS: http//ianmartinphotography.com/test-site/

My cufon buttons are at bottom. 我的cufon按钮位于底部。

h3  {color: #79868e; font-family: helvetica; font-size: 21px; margin:5px 0 0 0; } 
a:link    {color: #555055; text-decoration: none; outline:none;}
a:visited {color: #555055; text-decoration: none; outline:none;}
a:hover   {color: #79868e; text-decoration: none; outline:none;}

<div id="about"><h3><a href="about">about</a></h3></div>

Have you tried #FFFFFF instead of white? 你试过#FFFFFF而不是白色吗?

Couldn't you simply have: div.button2:hover {color: #FFFFFF;} 您不能简单地拥有:div.button2:hover {color:#FFFFFF;}

And not have !important? 没有!重要吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM