Next is the same-level node, and children is the child node.
<Div>
<Ul>
<Li class = "first"> <a href = "#"> This is Level 1 menu. </a>
<Ul>
<Li class = "second"> <a href = "#"> This is level-2 menu 11 </a> </li>
<Li class = "second"> <a href = "#"> This is level-2 menu 12 </a> </li>
</Ul>
</Li>
<Li class = "first"> <a href = "#"> This is Level 1 menu 2 </a>
<Ul>
<Li class = "second"> <a href = "#"> This is Level 2 menu 21 </a> </li>
<Li class = "second"> <a href = "#"> This is level-2 menu 22 </a> </li>
</Ul>
</Li>
</Ul>
</Div>
The jquery code is as follows:
$ (Document). ready (function (){
$ ("Li. first"). hover (function (){
$ (This). children ("ul"). slideDown (); the ul node indicating the blacklist is found.
},
Function (){
$ (This). children ("ul"). slideUp ();
});
});
If it is changed to $ (this). next ("ul"), it cannot be found because there is no ul node at the same level as it!
From Xu Yue's column