I set up a jsfiddle here to show some of the inconsistencies I'm noticing.
- Opera throws 'bonus' transition events for you to dodge...
- Firefox is probably as it should be, which is still frustrating...
- Chrome is predictably great, even making assumptions for me like
event.target.style["margin-left"]
giving the correct value instead of requiring me to useevent.target.style[event.propertyName.toCamelCase()]
I'd like to know the cleanest possible unified approach to this. Thanks.
To work around Opera I animated a property that wouldn't be visually evident
This might (or not) suit your needs.
Unfortunately given the disparate state of browser implementations of the
transitionend
event it seems the best approach is to check that theevent.propertyName
REALLY is the property you are looking for. This can be done by checking it against a knownobject
orstring
which contains a map of the properties that should be transitioning. The current solution I used: