I am working with a scrollable div and I need to find a way to conditionally stop it from scrolling.
Here is an example of the code:
if(theDiv.scrollTop + theDiv.clientHeight + thisScrollAmount > theDiv.scrollHeight)
StopScrolling();
How can I determine the actual amount the scroll has scrolled?
(I am aware that event.wheelDelta
is usually +-120, but the real amount scrolled may differ.)
EDIT I apologize for any confusion. It seems like my question was not clear enough. I wanted to know how much the div WOULD scroll if the event was not canceled by its handler. I thought it might have different values, but it turns out it consistently takes on values of +- 120.
Maybe this question should be removed.