tags:

views:

1692

answers:

4

Hi all,

I'm using cufon text replacing from Jquery http://wiki.github.com/sorccu/cufon/styling

but I have a problem:

I have something like this

<ul>
<li>item1</li>
<li>
    item2
    <ul><li>itemSec1</li></ul>
</li>

I applied cufon for "ul li " but i don't want to use cufon for "ul li ul li",

Cufon.replace('ul li');

Can I stop cufon for that one ?

Thanks!

A: 

Haven't tried it, but:

Cufon.replace('ul>li:only-child');
jerone
+1  A: 
   Cufon.replace('ul > li');

i think :only-child will fail http://docs.jquery.com/Selectors/onlyChild

antpaw
Correct, `:only-child` selects an element only if it is an *only child* of the parent element (i.e. there are no other elements descended from it.) **See:** (New documentation) http://api.jquery.com/only-child-selector/
Sean Vieira
+1  A: 

The only way that you can do this currently (without modifying the Cufon.replace method) is to add a class to the <ul>s you want do do replacement on. That way you can do this:

Cufon.replace('ul.use_cufon_class>li');

Which should get you exactly what you want.

Sean Vieira
A: 

One possible selector to avoid adding class for the UL, if you know where ULs are used:

Cufon.replace('#something > ul > li');
jholster