jQuery only apply to current li
Posted
by kylex
on Stack Overflow
See other posts from Stack Overflow
or by kylex
Published on 2010-05-17T17:41:36Z
Indexed on
2010/05/17
17:51 UTC
Read the original article
Hit count: 196
I want to slide toggle the second level ul when I mouse over the relevant first level li.
Currently the script displays all secondary ul on a mouseover.
<div id="subNav">
<ul>
<li>One</li>
<ul>
<li>SubOne</li>
</ul>
</li>
<li>Two</li>
<li>
<ul>
<li>SubTwo</li>
</ul>
</li>
</ul>
</div>
And here is my jQuery
$("#sideNav ul li").hover(
function(){
$('#sideNav ul li ul').slideDown();
},
function(){
$('#sideNav ul li ul').slideUp();
}
);
© Stack Overflow or respective owner