Created
February 24, 2014 19:42
-
-
Save wemakeweb/9195515 to your computer and use it in GitHub Desktop.
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
$(function(){ | |
var height, $nav, $win = $(window), klasse, hasClass = false; | |
/* Config */ | |
/* Scroll Weite in pixelen */ | |
height = 690; | |
/* Element dem die klasse hinzugefügt wird */ | |
$nav = $('.navbar-inner'); | |
/* class die hinzugefügt wird */ | |
klasse = 'scrolled'; | |
$win.on('scroll', function(){ | |
if( $win.scrollTop() > height && !hasClass ){ | |
hasClass = true; | |
$nav.addClass(klasse); | |
} else if( $win.scrollTop() < height && hasClass ){ | |
hasClass = false; | |
$nav.removeClass(klasse); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment