Skip to content

Instantly share code, notes, and snippets.

@asadaly111
Created April 7, 2016 07:43
Show Gist options
  • Save asadaly111/5d0e89f32a669098fe81a93290e04281 to your computer and use it in GitHub Desktop.
Save asadaly111/5d0e89f32a669098fe81a93290e04281 to your computer and use it in GitHub Desktop.
Sticky Header
var windowWidth = jQuery(window).width();
if(windowWidth > 768){
jQuery('.menu').addClass("remove-scrol");
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > 100){
jQuery('.menu').addClass("sticky");
}
else{
jQuery('.menu').removeClass("sticky");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment