Question

I am trying to add auto pagination to a page with javascript slimscroll plugin. What I need is to detect a position which is almost 200px above the end of that page, so that I can call the function for displaying the next page (which will be appended at the bottom) at this position of the scrollbar. I am using the 'slimscrolling' event in slimscroll and hence i can track the location of the scroll at any time. But when the div is loaded with two or three such pages, how can i get a position which is somewhat above 200px from the current bottom. If I use 'slimscroll' event instead of 'slimscrolling' event, i can get nothing otherthan 'top' or 'bottom'. Please help

$("#learn-notifications-inner").slimscroll().bind("slimscrolling", function(e, pos) {
// somehow find the position (new_position) which is 200px above the current bottom 
  if(pos >= new_position)
    paginate_notifications()
});
Was it helpful?

Solution

There are two events slimscrolling and slimscroll. The slimscroll event only sends 'top' or 'bottom'. Maybe check to see that it is right.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top