-
Notifications
You must be signed in to change notification settings - Fork 56
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
How to start countup only when scrolled? #24
Comments
When div scrolled, call |
can you give me example of code for this one? |
you can use |
I have same issue. Can you share any live example? |
would appreciate live example as well |
Hello, I was having problems of this type and finally I solved it as follows. First add the scroll directive before your Vue instance:
Then, where they place the component, they add the attribute ref = "firstcomponent" (change the name of the ref) and v-scroll = "onReady" (method that will update the counter) to each component that they want to "update" to the time to scroll. Example:
Finally, in the method, they can do an if of this type:
By doing this, each time the scrollY is greater than 800, each component will be updated with the assigned value, in this case "100". |
There is already a scroll spy in the countup.js library, but because instance.start() is always called, this option ( |
I want to start Countup Event when div scrolled, not on page load.
how to implement this?
The text was updated successfully, but these errors were encountered: