In HTML where an element contains scroll bars. You can write code which is called when these events fire using the following:
<div önscroll="dosomething();"></div>
You can also add a event listener using javascript:
object.addEventListener ("scroll", handler, useCapture);
The following is good article which discusses the onscroll event.
http://help.dottoro.com/ljurkcpe.php[
^]