gausie Posted March 7, 2008 Share Posted March 7, 2008 <script type="text/javascript"> function scrollPosition(){ if (navigator.appName == "Microsoft Internet Explorer"){ return document.body.scrollTop; }else{ return window.pageYOffset; } } function dirScrolling(prev) { var current = scrollPosition(); if (prev > current){ document.getElementById('c').innerHTML = "V"; }else if (prev < current){ document.getElementById('c').innerHTML = "^"; }else{ document.getElementById('c').innerHTML = "="; } t = setTimeout(dirScrolling(current),500); } </script> Why does this not change the div when I scroll? Link to comment https://forums.phpfreaks.com/topic/94962-detecting-direction-of-scroll/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.