Created
December 5, 2012 08:05
-
-
Save fredeerock/4213674 to your computer and use it in GitHub Desktop.
Move DIV on scroll
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
<script type="text/javascript"> | |
$(window).scroll(function() { | |
$('.whiteout').css('top', $(this).scrollTop() + "px"); | |
$('.whiteout').css('position', 'absolute'); | |
if($(this).scrollTop() < 100){ | |
$('.whiteout').css('position', 'static'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment