开发者

Cufon / Jquery Parent Item only

I have a multi stepped navigation and I want to apply cufon to only the top level.

So it goes like this:

<ul>开发者_如何学编程
     <li>
         <a href="#"> CUFON ME </a>
         <ul><li>sub nav, dont cufont me</li></ul>
     </li>
</ul>

Right now its selecting all the child elements, I just want the top level one to be selected.

Cufon.set('fontFamily', 'Museo Sans 500').replace('h1')('h2')('h3')('.menu-header ul#menu-main-nav li a');


Not sure about the cufon syntax, but try

Cufon.set('fontFamily', 'Museo Sans 500').replace('h1')('h2')('h3')('.menu-header ul#menu-main-nav > li > a');

(though the .menu-header descentant selection is useless because the #menu-main-nav is an ID selector - or are there multiple elements with the same ID?)

This uses the > child selector to make sure cufon is only applied to the first descentant, also called child.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜