internet explorer - Javascript get scroll amount in IE -


i have div scrollable want conditionally stop scrolling.

the code like:

if(thediv.scrolltop + thediv.clientheight + thisscrollamount > thediv.scrollheight)     stopscrolling(); 

how can amount scroll scrolled? (i know event.wheeldelta typically +-120, seems amount scrolled when 1 scrolls can quite different that.)

edit apologies. seems question unclear. looking how div would scroll if event not canceled it's handler. assuming took on different values, appears take on values +- 120.

perhaps should deleted.

    //works pretty  <style type="text/css">   #divtest{width:150px;height:200px;overflow:auto} </style>  <script>   var  amountcanscroll = 400   function maxscroll( ){     if( document.getelementbyid('divtest').scrolltop > amountcanscroll){       document.getelementbyid('divtest').scrolltop = amountcanscroll;     }   } </script>   <body><div id="divtest" onscroll="maxscroll()" >       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>       1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>1<br/>     </div> </body> 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -