开发者

Select top level list items only with Cufom, Jquery

开发者 https://www.devze.com 2023-01-05 16:29 出处:网络
The below JS is selecting all of the list items, i need to select only the top level list item anchors.

The below JS is selecting all of the list items, i need to select only the top level list item anchors.

HTML and Cufon below:

<script type="text/javascript">
     Cufon.replace('#navigation ul#nav li a', {
         textShadow: '#dedede -1px -1px',
         hover: { color: '#2a668f' }
     });
 </script>

<ul>
<li><a></a>&开发者_开发问答lt;/li>
<li><a></a></li>
<li><a></a>
  <ul>
  <li><a></a></li>
  <li><a></a></li>
  <li><a></a></li>
  </ul>
</li>
</ul>

Thanks in advance.


Use the child selector:

Cufon.replace('#navigation ul#nav > li > a'
0

精彩评论

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

关注公众号