Jump to content

Problem with this scroller javascript.


lynxus

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.