Skip to content

Instantly share code, notes, and snippets.

@fredeerock
Created December 5, 2012 08:05
Show Gist options
  • Save fredeerock/4213674 to your computer and use it in GitHub Desktop.
Save fredeerock/4213674 to your computer and use it in GitHub Desktop.
Move DIV on scroll
<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