For some reason I cannot get this scrollTop to behave like I would expect. Why is it returning 0. The first two calls to outerheight and scrollheight return 250 which is the pixel height of the col. My intention is to have the user scroll down while reading some legal text. I need to constantly check in realtime what the position of the scrollbar is when the user moves it. I cant seem to figure out how to attach an event to the scrollbar when its moved and then update the current position relative to the height of the containing div.. I need to know how many pixels from the top the scrollbar is.
The checkbox selected together with the scrollbar being down at the bottom must both be true, so what i need is to detect the position of the scrollbar to know if its at the bottom. I have seen tutorials online about how to do this but they deal with the whole page being scrollable, what I am looking for is just a div being scrollable and a way to detect its position.
var col = $('.inner');
col.outerHeight();//250
col.get(0).scrollHeight; //250
col.scrollTop(); //0
thanks,