Reputation: 3429
The Fixed-to-top navbar when used in mobile view (i.e. clicking a Navbar icon) does not collapse afterwards. the page is loading. so how to stop the page loading in navbar
This is my website link:
And this is my javascript code
// 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;
},
Below i attached the screen shot
Upvotes: 0
Views: 1052
Reputation: 650
Add type="button"
on
<button class="btn btn-responsive-nav btn-inverse" data-toggle="collapse" data-target=".nav-main-collapse"><i class="fa fa-bars"></i></button>
Upvotes: 1