jQuery-slimScroll
jQuery-slimScroll copied to clipboard
Is there a way to detect slim scroll to top event?
I want to know if there is an option that let me detect if the user is scrolling to top or scrolling down ?
Do you mean that you want to know if the user scrolls all the way to the top or the bottom, or that you want to know if the user is scrolling up or down? They're two different things.
In any case, according to the documentation the only event built in to the plugin is the slightly generically-named slimscroll
event, fired when the scrollbar reaches the top or the bottom of the parent element. Maybe you could make use of that to achieve what you need. If not, you'd have to write something yourself.
@RahmaMzoughi Yes there are two things in your question
- If you just want to know if the user is scrolling to top or scrolling down then there is a solution which I got here stackoverflow
- If the user is scrolled to bottom or top then you should try this
$('.slim-scroll').on('slimscroll', function(e, pos){ console.log(pos); });
with some additional modifications listed here in the plugin itself depending on the jquery version you using