JavaScript Drop down navigation on click

Traditional drop-down navigation is activated on hover. With some additional even handling, you can make it activate on click.
$('ul#nav').children('li').children('a').click(function(e) {
	if ($(this).siblings('ul').length === 0)


$('ul#nav').children('li').mouseleave(function() {
Posted by
Snippet Viewed 1255 times.

Share your JavaScript code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.


Submit | Browse

Most Recent javascript snippets

Most Viewed