Topic: scrolling-navbar.js has a bug
It does not seem to check if it is needed, so it drops errors on scrolling.
Fixed version
'use strict';
/* SCROLLING NAVBAR */
var OFFSET_TOP = 50;
var SCROLLING_NAVBAR = (($('.navbar').length)?true:false);
if(SCROLLING_NAVBAR) {
$(window).scroll(function () {
if ($('.navbar').offset().top > OFFSET_TOP) {
$('.scrolling-navbar').addClass('top-nav-collapse');
} else {
$('.scrolling-navbar').removeClass('top-nav-collapse');
}
});
}
Bartłomiej Malanowski staff pro premium answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No