开发者

Cufon: changing font-weight on hover

I am using Cufon to embed <a> tags with the 'Print Clearly' typeface.

On the hover state of the <a> tag I would like the text to change to bold, 开发者_如何转开发how can I do this with Cufon?

<script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/print-clearly_400.font.js" type="text/javascript"></script> 
<script type="text/javascript">
   Cufon.replace('a', fontWeight: 'normal',
    hover: {
        fontWeight: 'bold'
    });
</script>


Note that you cannot add a hover effect to an element that has already been replaced. You can, however, replace the hoverable element first and then the parent element after that. The hover effect will still apply.

But you can setup it on load:

Cufon('h1', {
    fontWeight: 'normal',
    hover: {
        fontWeight: 'bold'
    }
});

Further reading.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜