Created
August 26, 2016 19:33
-
-
Save GioRosso/0866bc61412e0dde87d7d95c094842d2 to your computer and use it in GitHub Desktop.
On fixed position, change CSS and visibility of a DIV
This file contains hidden or 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() { | |
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