-
-
Save Realetive/b92d2ed9129f3a6b90ce to your computer and use it in GitHub Desktop.
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.onscroll = scroll; | |
function scroll () { | |
var scrollTop = window.pageYOffset; | |
console.log(scrollTop); | |
if( scrollTop > 363 ){ | |
document.getElementById('summary').style.top="20px"; | |
document.getElementById('summary').style.position="fixed"; | |
} | |
else | |
{ | |
document.getElementById('summary').style.position="relative"; | |
document.getElementById('summary').style.top="50px"; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment