NoteOnMe博客平台搭建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
662 B

// Check scroll position and add/remove background to navbar
function checkScrollPosition() {
if($(window).scrollTop() > 50) {
$(".fixed-header").addClass("scroll");
} else {
$(".fixed-header").removeClass("scroll");
}
}
$(document).ready(function () {
// Single page nav
$('.fixed-header').singlePageNav({
offset: 59,
filter: ':not(.external)',
updateHash: true
});
checkScrollPosition();
// nav bar
$('.navbar-toggle').click(function(){
$('.main-menu').toggleClass('show');
});
$('.main-menu a').click(function(){
$('.main-menu').removeClass('show');
});
});
$(window).on("scroll", function() {
checkScrollPosition();
});