Skip to content

Animate when target element is scrolled into view #273

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

Merged
merged 4 commits into from
Mar 2, 2022
Merged

Conversation

inorganik
Copy link
Owner

Provides new options which enable scroll spy, so that as user scrolls to the target element, it begins counting animation automatically once it has scrolled into view. Demo: https://countup-typescript.stackblitz.io

New options are:

export interface CountUpOptions {
  ...
  enableScrollSpy?: boolean; // start animation when target is in view
  scrollSpyDelay?: number; // delay (ms) after target comes into view
}

Closes #270

@inorganik
Copy link
Owner Author

FYI @glennreyes @xlsdg - added 2 new options to allow for animation to be triggered by scroll spy.

@inorganik inorganik merged commit a39283e into master Mar 2, 2022
@inorganik inorganik deleted the feat/scroll-spy branch March 2, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start counting when item is on screen
1 participant