fix dcl navbar link navigation

This commit is contained in:
Arvind Tiwari 2018-03-22 00:52:59 +05:30
parent db99a40059
commit 049cf5afa2

View file

@ -107,11 +107,15 @@
var href = $(this).attr('href'); var href = $(this).attr('href');
$('.navbar-collapse').removeClass('in'); $('.navbar-collapse').removeClass('in');
$('.navbar-collapse').addClass('collapsing'); $('.navbar-collapse').addClass('collapsing');
if (href[0] === "#") {
if ($(href).length) { if ($(href).length) {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(href).offset().top - 50 scrollTop: $(href).offset().top - 50
}, 1000); }, 1000);
} }
} else if (href) {
window.location = href;
}
}); });
} }