AlexC
AlexC

Reputation: 9661

Cufon, jquery text repacement

I'm using cufon text replacing from Jquery https://github.com/sorccu/cufon/wiki/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!

Upvotes: 0

Views: 7344

Answers (5)

Voxl
Voxl

Reputation: 11

This works fine:(tested)

Cufon.replace('ul:has(ul) > li a');

Upvotes: 1

jholster
jholster

Reputation: 5136

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

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

Upvotes: 1

Sean Vieira
Sean Vieira

Reputation: 160043

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.

Upvotes: 3

antpaw
antpaw

Reputation: 16015

   Cufon.replace('ul > li');

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

Upvotes: 1

jerone
jerone

Reputation: 16881

Haven't tried it, but:

Cufon.replace('ul>li:only-child');

Upvotes: 0

Related Questions