

Detecting CSS Animation and Transition End with JavaScript - osvaldasv
http://osvaldas.info/detecting-css-animation-transition-end-with-javascript

======
onion2k
_the user could accidentally buy what they did not intend to_

This is _absolutely_ the wrong way to write front end code.

What the browser renders should only ever be a representation of the state of
an internal model (eg the basket in this case). You should update the state of
that model and then render what it's changed to if that change is successful.
In the case of an eCommerce app that change should involve a round trip to the
server to update the session. Querying the HTML to find out the state is bad
enough (it's slow) but relying on a CSS animation to complete in order to
remove something from a user's cart is just about the most stupid thing I've
seen in 20 years of web development.

