i have
<ul>
<li class="section-title">HEADER which triggers dropdown</li>
<li><a href="element_one">element one</a></li>
<li><a href="element_one">element one</a></li>
<li><a href="element_one">element one</a></li>
</ul>
i'm hiding all li-elements (except the first one) with this line:
$('#menu ul li.section-title:first-child').parent().children('li').hide();
i wonder if it's possible to query if one of those three links is active and if so nothing should hide!
is that even possible? thank you for your help!
Why not attach a class to the active link, then you could do something like:
li
elements (including the first one).Use
$('#menu ul li:not(:first-child)').hide();
to hide all but the first one..For the next part (to only hide them if none is the current one) use
Update with working code, after comment
live example: http://jsfiddle.net/gaby/SMmtS/21/