jQuery-slimScroll icon indicating copy to clipboard operation
jQuery-slimScroll copied to clipboard

Is there a way to detect slim scroll to top event?

Open RahmaMzoughi opened this issue 7 years ago • 2 comments

I want to know if there is an option that let me detect if the user is scrolling to top or scrolling down ?

RahmaMzoughi avatar Jan 04 '18 10:01 RahmaMzoughi

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.

philipstratford avatar Jan 12 '18 16:01 philipstratford

@RahmaMzoughi Yes there are two things in your question

  1. 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
  2. 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

DevVIN avatar Jun 15 '20 11:06 DevVIN