bootstrap navbar click
Hide Bootstrap side navbar when click outside of it
Judging by the class names, I think you're using bootstrap on your site.
If that is the case, then you can just use the in-built nav functionalities provided by Bootstrap itself for toggling your nav
$(window).click(function(e) {
if($(".navbar-collapse").hasClass("show")){
$('.navbar-collapse').removeClass("show");
e.preventDefault();
}
});
$('.navbar-collapse').click(function(event){
event.stopPropagation();
});
Hide Bootstrap side navbar when click outside of it
Judging by the class names, I think you're using bootstrap on your site.
If that is the case, then you can just use the in-built nav functionalities provided by Bootstrap itself for toggling your nav
$(window).click(function(e) {
if($(".navbar-collapse").hasClass("show")){
$('.navbar-collapse').removeClass("show");
e.preventDefault();
}
});
$('.navbar-collapse').click(function(event){
event.stopPropagation();
});
尊贵的董事大人
英文标题不为空时 视为本栏投稿
需要关键字 描述 英文标题