开发者

Cufon selector problems

开发者 https://www.devze.com 2022-12-31 09:21 出处:网络
I am using Cufon (http://cufon.shoqolate.com/generate/) to replace some text in a menu. Problem is that I only need to style the first <li> of the first <ul>.

I am using Cufon (http://cufon.shoqolate.com/generate/) to replace some text in a menu.

Problem is that I only need to style the first <li> of the first <ul>.

I have tried using:

Cufon.replace('#menu ul li > a', { fontFamily: 'Christopherhand', hover: { color: '#99c635'}});

With the > seperator, but it does not work. It still replaces the #menu ul li ul li a

This is my markup:

<div id="menu">
    <ul>
        <li class="current">
            <a href="#1">About JW</a>
            <ul>
                <li><a href="#2">Subpage 1</a></li>
    开发者_开发百科            <li><a href="#3">Subpage 2</a></li>
                <li><a href="#4">Subpage 3</a></li>
                <li><a href="#5">Subpage 4</a></li>
            </ul>
        </li>
        <li><a href="#2">Our Products</a></li>
        <li><a href="#3">Best Recipes</a></li>
        <li><a href="#4">Health &amp; Diet</a></li>
        <li><a href="#5">Our Ads</a></li>
    </ul>
</div>

Can anyone see the problem? It should work without adding a class to sub <ul>. :-)

Thank you.


You can use:

Cufon.replace('#menu > ul:first > li:first > a');

but you have to include jQuery before cufon import in order to use such selector.

https://github.com/sorccu/cufon/wiki/usage

0

精彩评论

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