Cufon conflicting with Bootstrap active class

Hi,

I'm using Bootstrap 3 to create a tabbed navigation. This all works fine. However, I also want to use cufon for the font in the tab headings. As soon as I add this in it overrides the font color which should be applied to my active class.

You can see what I mean on this jsfiddle:
http://jsfiddle.net/ZNT8x/5/

Just comment out this line to see the font colour working correctly:
Cufon.replace('.nav-pills > li > a', { fontFamily: 'Helvetica Neue' });

And leave it uncommented to see the font family working correctly.

Is there any way I can have them both working correctly together? (btw I have tried using @font-face instead but the font doesn't look nearly as good as it does with cufon, so would rather stick with cufon if possible).

Thanks.
bess1976Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
You would need to trap the click event on the tab and call Cufon.refresh()
0
bess1976Author Commented:
Hi Gary,

Thanks very much for getting back to me. But how would I do that exactly? I'm afraid javascript is definitely not my strong point. I tried using Cufon.refresh() but I think I was putting it in the wrong place. Are you saying I need to amend the Bootstrap core files? I'd rather not do this if possible. If there's any chance you could show me an example on the jsfiddle I'd be very grateful.
0
GaryCommented:
With jquery which seems to be recommended for Cufon (and a lot easier) add

http://jsfiddle.net/GaryC123/ZNT8x/6/
$("#pills li").click(function(){
        Cufon.replace("#pills li", { color:"#666" });
        Cufon.replace(this, { color:"#fff" });
})

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bess1976Author Commented:
Thanks so much for your help - that's works perfectly. Much appreciated.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.