Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript auto hide navbar

$(window).click(function(e) {

    if($(".navbar-collapse").hasClass("show")){
       $('.navbar-collapse').removeClass("show"); 
       e.preventDefault();
       }
});
 
$('.navbar-collapse').click(function(event){
      event.stopPropagation();
});

// use 'navbar-collapse' on your navbar
 
PREVIOUS NEXT
Tagged: #javascript #auto #hide #navbar
ADD COMMENT
Topic
Name
3+6 =