0
在移動視圖中使用固定到頂部的導航欄(即單擊導航欄圖標)之後不會摺疊。該頁面正在加載。所以如何阻止網頁加載在導航欄點擊鏈接後,擴展的移動導航欄不會摺疊
這是我的網站鏈接:
這是我的javascript代碼
// Anchors Position
$('[data-hash]').on('click', function(e) {
e.preventDefault();
$('body').addClass('scrolling');
var target = $(this).attr('href')
delay = 0;
if($(document).scrollTop() == 0) {
$(document).scrollTop($('#header').height());
delay = 200;
}
setTimeout(function() {
if ($(window).width() < 991 && $('.nav-main-collapse').hasClass('in')) {
$('.nav-main-collapse').collapse('hide');
self.scrollToTarget(target);
return this;
}
self.scrollToTarget(target);
}, 200);
return this;
});
return this;
},
下面我附屏幕截圖
非常感謝它的正常工作添加
type="button"
–