Site Skeleton
This commit is contained in:
16
mdb/js/modules/scrolling-navbar.js
Executable file
16
mdb/js/modules/scrolling-navbar.js
Executable file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
(function ($) {
|
||||
var SCROLLING_NAVBAR_OFFSET_TOP = 50;
|
||||
$(window).on('scroll', function () {
|
||||
var $navbar = $('.navbar');
|
||||
|
||||
if ($navbar.length) {
|
||||
if ($navbar.offset().top > SCROLLING_NAVBAR_OFFSET_TOP) {
|
||||
$('.scrolling-navbar').addClass('top-nav-collapse');
|
||||
} else {
|
||||
$('.scrolling-navbar').removeClass('top-nav-collapse');
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
Reference in New Issue
Block a user