If you don't mind removing them, as opposed to just hiding them, you
could do this:
$('.topMenu > li > ul > li').each(function() {
this.removeChild(this.firstChild);
});
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Oct 30, 2009, at 12:23 PM, hroyale wrote:
Hi,
I have a set of nested ULs that is generated for me. I want to use it
to create a drop-down navigation menu, however I don't want to use the
values in the second level of ULs in the navigation.
It looks something like this:
<ul class="topMenu">
<li>home</li>
<li>community
<ul>
<li>awards (not a link)
<ul>
<li>award type 1</li>
<li>award type 2</li>
</ul>
<li>discussions (not a link)
<ul>
<li>discussion 1
<ul>
<li>more info</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>news and events
<ul>
<li>news (not a link)
<ul>
<li>press coverage</li>
<li>press releases</li>
<li>announcements</li>
</ul>
</li>
<li>events (not a link)
<ul>
<li>conferences</li>
</ul>
</li>
</ul>
</li>
</ul>
Level one is visible as sort of tabs, and then mousing over should
reveal a list of the next level of links. However, I would like to use
the above list and mouse over "community" and see a list of links
award type 1
award type 2
discussion 1
rather than
awards
discussions
Or another option would be to combine levels 2 and 3 so I would see
awards
award type 1
award type 2
discussions
discussion1
and then mousing over discussion 1 would reveal the more info link.
Please don't send me code to do the drop-down menus. I have a ton of
those. I'm only looking for help dealing with the nested UL that I
want to skip over.
Thanks,
Heather