Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Animate entire menu slowly for totally collapsed mobile style?

Home Forums Older releases 0.9.x Animate entire menu slowly for totally collapsed mobile style?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2346
    oldgit
    Participant

    Is it possible to have entire menu animate down slowly for a totally collapsed mobile style?

    I used the “Adding a menu toggle button on small screens” code but I couldn’t control the slide down speed – it just seemed to toggle on and off

    Thanks

    #2348
    admin
    Keymaster

    Yes, you will need to use a slightly modified version of the JS code – for example, something like this:

    $(function() {
      $('#menu-button').click(function() {
        var $this = $(this),
            $menu = $('#main-menu');
        if (!$this.hasClass('collapsed')) {
          if (!$menu.hasClass('collapsed')) {
            $menu.slideUp(250, function() { $(this).addClass('collapsed').css('display', ''); });
          }
          $this.addClass('collapsed');
        } else {
          $menu.slideDown(250, function() { $(this).removeClass('collapsed'); });
          $this.removeClass('collapsed');
        }
        return false;
      }).click();
    });
    #2349
    oldgit
    Participant

    Thank you very much- perfect – you really know your JS inside out!
    May I suggest you include this functionality as an init option in next version – would make your menu all conquering!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘0.9.x’ is closed to new topics and replies.