is it OK to temporarily set properties on jQuery elements to let other function know that something is happening to that element?
For example:
- a function is doing animations with a element
- the user clicks on something that triggers another function that will animate the same element
=> one of the animations will fail and screw up the css 🙁
So maybe it’s better to set a property on that element, like el.animating = true while animations are running; this way other functions know what’s happening and stop…
You can use the
animated-selector[docs] to test if the element is currently being animated before running your animations:Example: http://jsfiddle.net/AGmX8/