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

CSS transition: all breaks reveal animations for elements visible on page load #543

Open
markmercier opened this issue Oct 17, 2021 · 3 comments
Labels

Comments

@markmercier
Copy link

Issue Report

If elements that are visible within the viewport when the page loads have a transition: all property defined in CSS, the reveal effect does not happen. Instead, those elements instantly become visible at their ending state, without an animation.

In the attached demos, you can see the right column of buttons (with transition: all) instantly become revealed, while the left column (with transition: all replaced with the more specific transition: background-color) have the expected reveal animation.

Curiously, this issue only seems to affect elements visible on page load. If you scroll down, all of the buttons have the expected reveal animation 👍.

Demos

Environment

  • Operating System: Mac OSX v10.15.7
  • Browser Version: Chrome, Safari, Firefox, Edge (latest)
  • ScrollReveal Version: 4.0.9
@jlmakes jlmakes added the Bug label Nov 7, 2021
@dijkermans
Copy link

I've read many js and performance issues regarding the 'all' property in general so I doubt it's only related to scrollreveal

@dijkermans
Copy link

Having said that, I noticed the same issue as well. A workaround would be great.

@prince-jagani
Copy link

This issue is causing because I have given that element transition property in CSS that cannot be overwritten by reveal function.

So remove that transition property from CSS and add callback function in your reveal method.

ScrollReveal().reveal('.button', { //reveal options..., afterReveal: (el) => { el.style.transition = '0.5s'; } })

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

4 participants