jQuery-slimScroll
jQuery-slimScroll copied to clipboard
scrolling position
how can i find the scrolling position? when it reached eg 500px, i want to scroll top
$(selector).slimScroll().bind('slimscroll', function(e, pos){
if(pos > 500)
$(selector).slimScroll({ scrollTo: '0px' });
});
regards
From version 1.0.9 onwards, this is the 'slimscrolling' event.
But this binding of slimscroll' brings exception saying "Undefined is not a function"
You can also try $(selector).scrollTop();
$(selector).slimScroll().bind('slimscroll', function(e, pos){ if(pos > 500) $(selector).slimScroll({ scrollTo: '0px' }); });
regards
pos variable is returning 'top' not any integer value.