Posted By

matthalliday on 02/26/10


Tagged

menu jquery nav Collapsable


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

alejandrosuch


Collapsable Navigation Menu with Unlimited Levels


 / Published in: jQuery
 

A lightweight, collapsable menu script that works no matter how many nested lists there are.

  1. $('#container ul li a').click(function() {
  2. if ( $(this).parent().children('ul').size() > 0 ) {
  3. $(this).parent().children('ul:first').toggle();
  4. $(this).parent().siblings().find('ul:visible').hide();
  5. }
  6. });

Report this snippet  

You need to login to post a comment.