views:

192

answers:

1

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

On the hover state of the 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>
A: 

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.

floatless
do I need to specify a second font for the bold? I have tried as above, and is appearing as the default browser font but the bold on hover is working. When I don't try the hover, the font replacement works properly. I have added my code above
theringostarrs