views:

442

answers:

1

Are there any events fired by an element to check wether a css3 transition has started or end?

+2  A: 

Webkit has this implemented only for transition end it would appear.

You can set a handler for a DOM event that is sent at the end of a transition. The event is an instance of WebKitTransitionEvent and its type is webKitTransitionEnd in JavaScript.

For example, the JavaScript code in Listing 6 displays an alert panel whenever a transition ends.

Listing 6 Handling transition end event

box.addEventListener( 'webkitTransitionEnd', 
    function( event ) { alert( "Finished transition!" ); }, false );

Opera

There is one type of transition event available. The oTransitionEnd event occurs at the completion of the transition.

rebus
Note that the event is called "transitionend" in firefox and "oTransitionEnd" in Opera
eskimoblood
Updated the answer to reflect this.
rebus