-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Custom event on viewport visible? #36
Comments
I like it. Any ideas on how you see this working? Perhaps something like: <div data-scroll-reveal="enter left and emit evt-name"> foo </div> I think there should be an event fired when an element enters the viewport, and when it leaves — meaning the above would trigger the events Thoughts? |
Cool. Your suggestion sounds good too: I've only used scrollReveal for a short while, so I'm not familiar with the underlying code, but from a users standpoint keeping the current sugar syntax makes sense. Is it likely that you will implement this yourself anytime soon or should I give it a go and make a pull request? |
I've made a working prototype. Working on this I've discovered several possible approaches. Problem is that I sort of like all of them. Hoping to get some feedback.
<div data-scroll-reveal="enter left and notify someFunction, exit otherFunction"> foo </div>
This would deviate a bit from my original post, but does allow a lot of flexibility.
<div id="somediv" data-scroll-reveal="enter left"> bar </div>
|
Nice work Knut, I’ll review and get back to you over the weekend. (It’d be nice if we had some more input from others on this too!) |
Thanks for the ideas @IndexOverflow ! Callbacks are now supported in |
Hi, thanks in advance |
@Alaamasoud you would have to use |
A great addition to scrollReveal would be the ability to trigger your own JS events on viewport visibility.
The text was updated successfully, but these errors were encountered: