Html5 -webkit-transition Doesn't Work If I Set It Right Before Setting Something Else Using Javascript On Chrome
Solution 1:
From the CSS Transitions specification:
... changing any of the transition properties a small amount of time after making a change that might transition can result in behavior that varies between implementations, since the changes might be considered simultaneous in some implementations but not others.
In your alternative version, you change the className
and update the transform
without allowing the browser to calculate the consequences of the change to the className
. (This typically happens when you return control to the event loop.) Therefore, the browser may still be operating from the old value of the transition
property (which is the default value of all 0s ease 0s
). If that occurs, then the property change takes place immediately with no animation since the delay and duration are 0s
.
Post a Comment for "Html5 -webkit-transition Doesn't Work If I Set It Right Before Setting Something Else Using Javascript On Chrome"