Created
November 15, 2013 03:15
-
-
Save malachi358/7478540 to your computer and use it in GitHub Desktop.
Jquery Switch class on Scroll!
This file contains hidden or 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
$(function() { | |
var header = $(".clearHeader"); | |
$(window).scroll(function() { | |
var scroll = $(window).scrollTop(); | |
if (scroll >= 500) { | |
header.removeClass('clearHeader').addClass("darkHeader"); | |
} else { | |
header.removeClass("darkHeader").addClass('clearHeader'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment