Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
another stab at fixing animate() for elements just added to DOM #586
@madrobby, I want you to take a look at this.
Activating CSS transitions for an element just added to the DOM won't work in either Webkit or Mozilla. To work around this, we used to defer setting CSS properties with setTimeout (see 272513b).
This solved the problem for Webkit, but not for latest versions of Firefox. Mozilla seems to need at least 15ms timeout, and even this value varies.
A better solution for both engines is to trigger "layout". This is done here by reading