Created
April 7, 2016 07:43
-
-
Save asadaly111/5d0e89f32a669098fe81a93290e04281 to your computer and use it in GitHub Desktop.
Sticky Header
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
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