Reputation: 11989
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
Upvotes: 9
Views: 18442
Reputation: 11
Using jQuery: Use the css class to h1 and specify in the selector...
$('h1.noCufon').each(function(){
var cufonText = '';
$('cufontext',$(this)).each(function(){
cufonText+=$(this).html();
});
if(cufonText!=''){
$(this).html(cufonText);
}
})
Upvotes: 1
Reputation: 31
function remove_cufon(selector) {
$(selector).html( cufon_text(selector) );
return true;
}
function cufon_text(selector) {
var g = '';
$(selector +' cufon cufontext').each(function() {
g = g + $(this).html();
});
return $.trim(g);
}
Usage:
remove_cufon('#name');
Upvotes: 3
Reputation: 3967
by single h1 you mean?
$('h1').each(function(){
if($(this).siblings('h1').length)
Cufon.set('fontFamily', 'DIN Medium').replace(this);
});
Upvotes: 0
Reputation: 2039
Depending on which selector engine you use, you can:
Cufon.replace('h1:not(.clean)');
Upvotes: 11