Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on scrolling on/off #11

Open
mnakalay opened this issue Apr 22, 2017 · 4 comments
Open

on scrolling on/off #11

mnakalay opened this issue Apr 22, 2017 · 4 comments
Labels

Comments

@mnakalay
Copy link

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

@ryanpcmcquen
Copy link
Owner

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

@mnakalay
Copy link
Author

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
Copy link
Author

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

@ryanpcmcquen
Copy link
Owner

@Tarabyte, any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants