Close menu on link tap

Forums Help and How To Close menu on link tap

This topic contains 2 replies, has 3 voices, and was last updated by  marrco 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Dan_
    Member

    Hello BSS users,

    Anyone here know how to make the mobile menu close immediately after a menu link is tapped? My website is http://www.plugone.co.za

    I’m using the BSS better-nav on:
    https://github.com/bootstrapstudio/bootstrap-better-nav

    bunrith
    Member

    Did you want exactly how the better-nav demonstrate? If so, follow the instruction to link the external file. It seems like your website needs exactly that when it is on the mobile screen.

    marrco
    Member
    Valued

    your site ain’t loading for me atm, so I can’t check the exact issue, but if you just need a Hamburger menu toggle you have to add your js. Something like:

    //Hamburger menu toggle
      $(".navbar-nav li a").click(function (event) {
        var toggle = $(".navbar-collapse").hasClass("show");
        if (toggle) {
          $(".navbar-toggler").click();
        }
      });
    
      $('.navbar-nav > li > a').on('click', function() {
        $('.navbar-collapse').collapse('hide');
    });
    
    $('.navbar-nav>li>a').on('click', function(){
        $('.navbar-collapse').collapse('hide');
    });
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.