Reply To: Vertical menu expanded on page load

Home Forums Older releases 0.9.x Vertical menu expanded on page load Reply To: Vertical menu expanded on page load

#2629
admin
Keymaster

Yep, replace the following:

  $('#menu-btn').click(function() {
    var $this = $(this),
        $menu = $('#main-menu');
    if (!$this.hasClass('collapsed')) {
      $menu.addClass('collapsed');
      $this.addClass('collapsed');
    } else {
      $menu.removeClass('collapsed');
      $this.removeClass('collapsed');
    }
    return false;
  }).click();

with the following:

  $('#menu-btn').click(function() {
    var $this = $(this),
        $menu = $('#main-menu');
    if (!$this.hasClass('collapsed')) {
      $menu.addClass('collapsed');
      $this.addClass('collapsed');
    } else {
      $menu.removeClass('collapsed');
      $this.removeClass('collapsed');
      $("#main-menu").smartmenus("itemActivate",$("#main-menu").find("a.current").eq(-1));
    }
    return false;
  }).click();

Cheers!

Register

You will be emailed a link to set your password.

Login

Lost password?