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

In transitions flicker at start #248

Closed
jods4 opened this issue Aug 16, 2014 · 4 comments
Closed

In transitions flicker at start #248

jods4 opened this issue Aug 16, 2014 · 4 comments

Comments

@jods4
Copy link

jods4 commented Aug 16, 2014

Let's say that I just added element to my DOM with javascript code and I want to do a nice 'in' animation, e.g.: $(element).velocity('bounceIn').

I noticed that when doing so, the element can flicker briefy on the screen before the animation starts. It's as if the bounceIn sequence doesn't set opacity = 0 immediately but waits for a tick or two.

I worked around that in two ways. If I always animate the entry of a CSS class, I put opacity: 0 or display: none in my stylesheet. It doesn't feel right, but it works.

Sometimes I don't always animate the creation a my CSS class, so I end up doing this:
$(element).css('opacity', 0).velocity('bounceIn')
But that's awkward, the transition call should take care of that for me. Especially since opacity: 0 is force-fed by the sequence, but it still flickers :(

@julianshapiro
Copy link
Owner

This only makes sense. Velocity doesn't run immediately upon page load; JavaScript compiler execution time, among other things (like your own JS), consumes some time upfront. So, of course you have to ensure your element starts at opacity: 0 (or simply display: none). It would be the same for any animation that attempts to bring opacity from 0 to 1.

Unless I'm missing something?

@julianshapiro
Copy link
Owner

I will be implementing this feature into the UI pack this week.

@jods4
Copy link
Author

jods4 commented Sep 10, 2014

Nice. This will really make the common use-case described above easier to use!

@julianshapiro
Copy link
Owner

Done. Coming up in the next release.

Rycochet pushed a commit that referenced this issue Aug 3, 2020
“In” transitioning elements have their initial opacity set to 0
immediately (instead of waiting for the first rAF tick). This removes
FOUC. Closes #248.

New Sequence Running feature. See: http://velocityjs.org/#uiPack.
Thanks @stephen. Closes #296.
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