Skip to content

Instantly share code, notes, and snippets.

@wireinet
Last active December 5, 2016 14:40
Show Gist options
  • Save wireinet/bf4246e998b2c4cd2d26b312fd5878be to your computer and use it in GitHub Desktop.
Save wireinet/bf4246e998b2c4cd2d26b312fd5878be to your computer and use it in GitHub Desktop.
fixed-menu
$(document).ready(function(){
var $menu = $(".menu-containers");
$(window).scroll(function(){
if ( $(this).scrollTop() > 100 && $menu.hasClass("top-menu-hide") ){
$menu.removeClass("top-menu-hide").addClass("top-menu-unhide"); }
else if($(this).scrollTop() <= 100 && $menu.hasClass("top-menu-unhide")) {
$menu.removeClass("top-menu-unhide").addClass("top-menu-hide"); }
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment