wesbos
wesbos

Reputation: 26317

Cufon jQuery Hover as a child element?

I'm having an odd problem with Jquery Hovers and Cufon.

My Nav is setup like this:

...

<li>
<a class="title" href="#">Title Text</a>
<a class="sub" href="#">Photo Gallery</a>
</li>

...

When I hover over the LI. I want the a.sub to turn white (which works by adding a class because its normal text.) and I ant the a.title to turn green.

The problem is that the Title is replaced by Cufon. I know cufon can do hovers when the element is hovered over, but how do I trigger it when a parent item is hovered over?

Here is my jQuery:

$('#bottomNav ul li').hover(

    function() {
        $("a.sub", this).addClass('hov');
        $("a.title", this).addClass('thov');
    }, 

    function() {
        $("a.sub", this).removeClass('hov');
        $("a.title", this).removeClass('thov');
    });

Upvotes: 1

Views: 698

Answers (1)

foxybagga
foxybagga

Reputation: 4214

easy ... use

Cufon.refresh();

or for hover, its recommended you use the cufon hover method

Cufon.replace('.your-class', {hover: 'true'}, { fontFamily: 'FONT' });

Cheers!

Upvotes: 1

Related Questions