Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GioRosso/0866bc61412e0dde87d7d95c094842d2 to your computer and use it in GitHub Desktop.
Save GioRosso/0866bc61412e0dde87d7d95c094842d2 to your computer and use it in GitHub Desktop.
On fixed position, change CSS and visibility of a DIV
<script type="text/javascript">
$(window).scroll(function() {
if ($(this).scrollTop()>850){
$("#bio-title").fadeOut();
$("#bio-facts").css( "height", "450" );
} else {
$("#bio-title").fadeIn();
$("#bio-facts").css( "height", "200" );
}
});
</script>
<div class="container">
<div id="bio-title">...</div>
<div id="bio-facts">-...-</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment