Enable navbar shrinking on scrolling
This commit is contained in:
@@ -1 +1,13 @@
|
||||
console.log('Hello, world');
|
||||
$(document).ready(function () {
|
||||
var scrollTop = 0;
|
||||
|
||||
$(window).scroll(function () {
|
||||
scrollTop = $(window).scrollTop();
|
||||
|
||||
if (scrollTop >= 100) {
|
||||
$('#nav').addClass('shrink');
|
||||
} else if (scrollTop < 100) {
|
||||
$('#nav').removeClass('shrink');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user