Skip to content

Instantly share code, notes, and snippets.

@jacekd
Created October 27, 2012 20:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save jacekd/3966005 to your computer and use it in GitHub Desktop.
Save jacekd/3966005 to your computer and use it in GitHub Desktop.
*
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll > 50) {
$(".menu-bar").addClass("menu-bar-scroll");
} else {
$(".menu-bar").removeClass("menu-bar-scroll");
}
});
(function(){
var menu_bar = $(".menu-bar ul");
var menu_active = menu_bar.find("li.active");
$(".menu-bar ul").hover(
function(){
menu_active.removeClass("active");
},
function(){
menu_active.addClass("active");
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment