In my application, I am animating the opacity of the elements on the page with something like:
.s { transition-property: opacity; transition-duration: 250ms; }
(with specific versions for a particular vendor). And then
.s.hidden { opacity: 0; }
So the animation starts when the hidden class is assigned. The problem is that mouse events are still detected on elements with zero opacity that I donโt need, so after completing the transition, I need to either set visibility to hidden or display to none . I hope I can do something like:
.s { transition-property: opacity, visibility; transition-duration: 250ms; transition-delay: 0, 250ms; }
and then
.s.hidden { opacity: 0; visibility: hidden; }
using the CSS transition mechanism for this is painless. As far as I can tell, this does not work, because visibility is an unmanaged property. But other transition structures, such as d3, handle non-animation properties, obviously, simply setting the value at the beginning of the transition or when it ends.
The best I could come up with was to use the transitionend event (and its browser-specific options like oTransitionEnd ) to catch the end of the transition and set visibility at that point, but I wonder if there is an easier way, it is advisable to stick exclusively to CSS . Or, as the name of my question suggests, is it the inanimate properties of just that?
user663031
source share