scrollEvents icon indicating copy to clipboard operation
scrollEvents copied to clipboard

on scrolling on/off

Open mnakalay opened this issue 8 years ago • 4 comments

Hello,

I just discovered your script and it is pretty cool.

One thing that surprised me though is there seems to be no way to react to simple scrolls.

For instance adding a class to an element on scrolling and removing it when scrolling stops.

Am I missing something or is that function not included?

Either way, thanks for a great script.

Nour

mnakalay avatar Apr 22 '17 16:04 mnakalay

Not explicitly, I can look into adding that. What do you imagine the API looking like?

ryanpcmcquen avatar Apr 23 '17 01:04 ryanpcmcquen

Thank you for answering.

I suppose 2 .whenScrolling() and .whenScrollingStopped(delay) functions would work. The delay would be to estimate whether the user really stopped scrolling or not.

Also, I think the trigger on scroll should be triggered only once, not continuously.

I don't know if this is helfpful?

mnakalay avatar Apr 23 '17 10:04 mnakalay

That will probably create a small problem and require a rewrite as you are testing for the type of the parameter and if it is a number you assume the function whenDistance() is called. So in the case of the whenStoppedscrolling() function there would be a problem as the argument would also be a number

mnakalay avatar Apr 23 '17 10:04 mnakalay

@Tarabyte, any ideas?

ryanpcmcquen avatar Apr 23 '17 17:04 ryanpcmcquen