mozilla
Your Search Results

    transitionend

    The transitionend event is fired when a CSS transition has completed. In the case where a transition is removed before completion, such as if the transition-property is removed, then the event will not fire. The event will also not fire if the animated element becomes display: none before the transition fully completes.

    General info

    Interface
    TransitionEvent
    Bubbles
    Yes
    Cancelable
    Yes
    Target
    document, element
    Default Action
    None

    Properties

    Property Type Description
    target Read only EventTarget The event target (the topmost target in the DOM tree).
    type Read only DOMString The type of event.
    bubbles Read only boolean Does the event normally bubble?
    cancelable Read only boolean Is it possible to cancel the event?
    propertyNameRead only DOMString The name of the CSS property associated with the transition.
    elapsedTimeRead only Float The amount of time the transition has been running, in seconds, when this event fired. Note that this value is not affected by the value of transition-delay.
    pseudoElementRead only DOMString The name (beginning with two colons) of the CSS pseudo-element on which the transition occured (in which case the target of the event is that pseudo-element's corresponding element), or the empty string if the transition occurred on an element (which means the target of the event is that element).

    Example

    /*
     * Listen for the transitionend event on a specified element, e.g. #slidingMenu
     * Then run a specified function, e.g. showMessage()
     */
    function showMessage() {
        alert('Transition has finished');
    }
    
    var element = document.getElementById("slidingMenu");
    element.addEventListener("transitionend", showMessage, false);
    

    Specifications

    Specification Status Comment
    CSS Transitions
    The definition of 'transitionend' in that specification.
    Working Draft Initial definition.

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
    Basic support 1.0 as webkitTransitionEnd
    36 as transitionend
    4.0 (2.0) 10 10.5 as oTransitionEnd
    12 as otransitionend
    12.10 as transitionend
    23 as transitionend
    3.2 as webkitTransitionEnd
    7.0.6 as transitionend
    Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
    Basic support 2.1 as webkitTransitionEnd 4.0 (2.0) ? 10 as oTransitionEnd
    12 as otransitionend
    12.10 as transitionend
    3.2 as webkitTransitionEnd

    See also

    Document Tags and Contributors

    Contributors to this page: Sheppy, teoli, louisremi, ethertank, nicofrand, tagawa, cvrebert, P0lip, nchase
    Last updated by: cvrebert,