views:

737

answers:

2

Hiya,

I currently use Cufon accross our site with something similar to Cufon.set('fontFamily', 'DIN Medium').replace('h1'); Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.

I can add classes etc to the H1 tag if required, and can do any HTML/CSS/JS just not changing the actual tag.

Anyone know if this is possible and if it is how?

Thanks in advance,

Shadi

A: 

by single h1 you mean?

$('h1').each(function(){
    if($(this).siblings('h1').length)
        Cufon.set('fontFamily', 'DIN Medium').replace(this);
});
Funky Dude
I don't think that will work, you are telling Cufon to replace all the h1 elements again. You can send the DOM element though.
jpabluz
This will just style all H1 tags.
Shadi Almosri
edited. meant to do that
Funky Dude
+1  A: 

Depending on which selector engine you use, you can:

  • add a class to your exception h1 element
  • you can use the :not selector to only apply cufon to the h1's that don't have the aforementioned class (with jQuery and classname 'clean' it would be something like Cufon.replace('h1:not(.clean)');
Thomas Maas
Genius! Very good selector! :)
Shadi Almosri