how do I find out if the user scrolled up to the top or down to the bottom in a scrollable container?
Does jQuery offer any mechanisms?
css:
#container {
display: block;
width: 250px;
height: 25px;
background: green;
}
#scrolling {
width: 250px;
height: 300px;
backround: red;
overflow: auto;
}
Thanks a lot!
Pat
will tell you the position from the top
-edit-
You can test the scroll position by comparing the height, scrollable height and scroll offset of the div:
fiddle
This example has reserved 5 pixels from the top and bottom of the div's margin.
Yes you can access the current scroll top value of a scrollable container.
Here working is jsFiddle.