Question

I searched on the web and stackoverflow a solution for exclude an element of Cufon transformation, because my font 'BlueHighwayDType' dosen't contains the '' symbol so I must exclude this element for be able see it on the ie7/8. http://www.matteowebdesigner.com/test/yesimove/

<!--head-->
<!--[if lt IE 9]>
<script type="text/javascript" src="js/cufon-yui.min.js"></script>
<script type="text/javascript" src="js/Blue_Highway_D_Type_400.font.js"></script>
<script type="text/javascript" src="js/mind-ie.js"></script>
<![endif]-->

The elements that I want replace are p and the element that I want exclude is span.small

<!--body-->
<article>
    <p>L'unico <strong>Personal Trainer</strong> <br/>
    che ti segue ovunque</p>
    <p>e ti permette di <strong>condividere</strong> 
    i tuoi progressi con i tuoi amici.</p>
    <p>A soli <strong>9.<span class="small">99 &euro;</span></strong> al mese !</p>
</article>

So I tried the example that i find on the web and I used the selector ':not' but it dosen't worked. look this:

/*mind-ie.js*/
$(document).ready(function() { // Start Functions
    Cufon.replace('#main #slogan section article p:not(.small)');
});

I don't understand because it doesn't work, I thought the selector was correct.

Was it helpful?

Solution

Even if in this case exclude all span element.

Cufon.replace('#main #slogan section article p',{ignore:{span:true}});

OTHER TIPS

The small class is actually exposed by the descendant <span> element, not by the <p> element.

Try using the :has() selector:

Cufon.replace("#slogan section article p:not(:has(.small))");

On second thought, this will ignore the <p> elements that contain elements matching .small, which may not be what you want. Specifying the ignoreClass option looks like a better idea:

Cufon.replace("#slogan section article p", {
    ignoreClass: "small"
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top