jQuery vertical dropdown menu
Instead of selecting .open and .open2, you could change your selector to see if there is a child &lt;ul&gt;.

$('li:has(ul)').hover(function() {
  $(this).find('ul').slideDown(400);
}, function() {
  $(this).find('ul').slideUp(400);
})


Edit: you can also hide all the child &lt;ul&gt; nodes at once instead of individually.

$('li ul').hide();


Reference

Here are the three main features of jQuery that I used. Each link uses &lt;api.jquery.com> which is a great place to learn about various jQuery functions.


:has() selector
.hover()
.find()