Skip to content

Instantly share code, notes, and snippets.

@seungjin
Created May 8, 2011 16:48
Show Gist options
  • Save seungjin/961491 to your computer and use it in GitHub Desktop.
Save seungjin/961491 to your computer and use it in GitHub Desktop.
scratch.. getting scroll position/location
<html>
<script>
var scrollCheck = function() {
var vscroll = (document.all ? document.scrollTop : window.pageYOffset);
console.log(vscroll);
}
</script>
<body onscroll=scrollCheck()>
<div id="myloop">
</div>
</body>
<script>
for (i=0;i<=50;i++) {
document.getElementById("myloop").innerHTML+="aaa<br/>"
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment