NOTE: this may be better handled with jQuery UI accordion

function initMenu(){

  var open = $("ul#menu").attr("id");
   
  $('#sidebar-left .menu li.not-active-trail ul').hide();
 
  $('#sidebar-left ul.menu li.not-active-trail.expanded a').hover(
    function() {
        if (open==null) {
          $(this).next().slideDown("normal");
          open = $(this).parent().attr("id");
        }
        else if (($(this).parent().attr("id") != open) && ($(this).parent().hasClass("expanded"))) {
          $("#" + open + " ul").slideUp("normal");
          $(this).next().slideDown("normal");
          open = $(this).parent().attr("id");
          }
    },
    function(){}); /* hover() requires empty callback function for off state even though we arent using it */
                   /*** WILL NOT RUN without this set to an empty function explicitly!!! ***/
}

Add your comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.