Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix animate() for elements just added to DOM
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 `clientLeft` from an element. There are other properties and methods that trigger layout; see http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html
- Loading branch information