Mark
Mark

Reputation: 488

Select top level list items only with Cufom, Jquery

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></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.

Upvotes: 0

Views: 541

Answers (1)

Pekka
Pekka

Reputation: 449713

Use the child selector:

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

Upvotes: 1

Related Questions