Created
September 12, 2018 10:31
-
-
Save Tsunamijaan/af52079ea3bdd9a031e41243f00757dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).on('scroll',function() { | |
var scroll = $(window).scrollTop(); | |
if (scroll < 245) { | |
$(".header-middle").removeClass("scroll-header"); | |
}else{ | |
$(".header-middle").addClass("scroll-header"); | |
} | |
}); | |
var nav_offset_top = $('header').height()+10; | |
/*------------------------------------------------------------------------------- | |
Navbar | |
-------------------------------------------------------------------------------*/ | |
//* Navbar Fixed | |
function navbarFixed(){ | |
if ( $('.menu-nav').length ){ | |
$(window).scroll(function() { | |
var scroll = $(window).scrollTop(); | |
if (scroll >= nav_offset_top ) { | |
$(".menu-nav").addClass("navbar_fixed"); | |
} else { | |
$(".menu-nav").removeClass("navbar_fixed"); | |
} | |
}); | |
}; | |
}; | |
navbarFixed(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment