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

New Callbacks: beforeReveal and beforeReset #273

Closed
ivangretsky opened this issue Jul 15, 2016 · 2 comments
Closed

New Callbacks: beforeReveal and beforeReset #273

ivangretsky opened this issue Jul 15, 2016 · 2 comments

Comments

@ivangretsky
Copy link

I need to start some js (CountUp.js) on event that happens when the element starts revealing, not when it is revealed. So it is being revealed already being animated. Can't find a callback for that. Am I missing it? If there is not one, is it possible to add it?

@jlmakes
Copy link
Owner

jlmakes commented Jul 15, 2016

I like this idea @ivangretsky

There is currently no such thing as beforeReveal and beforeReset, but it wouldn’t be too difficult to add those in. For now, I will icebox this for a future release.

@jlmakes jlmakes added the Icebox label Jul 15, 2016
@jlmakes jlmakes changed the title Callbacks for StartReveal or BeforeReveal New Callbacks: beforeReveal and beforeReset Jul 21, 2016
@jlmakes jlmakes removed the Icebox label Jul 21, 2016
@jlmakes
Copy link
Owner

jlmakes commented Jul 22, 2016

@ivangretsky Thanks for the request, great idea. It’s now live in 3.3.x 🎉

Example:

// Let’s see all 4 together now...
sr.reveal('.foo', {
  beforeReveal: (el) => console.log('Reveal started...'),
  afterReveal: (el) => console.log('Reveal complete.'),
  beforeReset: (el) => console.log('Reset triggered...'),
  afterReset: (el) => console.log('Reset complete.')
})

Re: @drawcard @danielkraus

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

No branches or pull requests

2 participants