Skip to content

Instantly share code, notes, and snippets.

@bryanmonzon
Created December 13, 2013 21:05
Show Gist options
  • Save bryanmonzon/7951306 to your computer and use it in GitHub Desktop.
Save bryanmonzon/7951306 to your computer and use it in GitHub Desktop.
<script>
function moveScroller() {
var move = function() {
var st = jQuery(window).scrollTop();
var ot = jQuery("#white_bar_stop").offset().top;
var s = jQuery("#white_bar");
if(st > ot) {
s.css({
position: "fixed",
top: "0px",
height: "auto",
});
} else {
if(st <= ot) {
s.css({
position: "relative",
top: "0"
});
}
}
};
jQuery(window).scroll(move);
move();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment