lynxus Posted August 11, 2009 Share Posted August 11, 2009 Hi guys , I have this: This basically just keeps a div scrolled to the bottom all the time. My question is.. How can i do it so it would ONLY run if the scrollbar is currently at the bottom. IE: If (scrollbar == bottom) { runscript; }else{ dont } What i want to achieve is this script will only run if the user has scrolled to the bottom , if they were to scroll up again it wouldnt run ( until they bring the scrollbar back to the bottom ) <script language="javascript" type="text/javascript"> function scroller(){ var objDiv = document.getElementById("sessiontext"); objDiv.scrollTop = objDiv.scrollHeight; } </script> Many thanks for looking -G Link to comment https://forums.phpfreaks.com/topic/169733-problem-with-this-scroller-javascript/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.