Skip to content
Add event listeners for CSS animations and transitions
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib
README.md

README.md

CSS-Animation-and-Transition-Listeners

Add javascript event listeners for CSS animations and transitions.

Useful for transitioning elements between display block and none.

Usage

Plugin works through normal HTML include or through NPM

Include

HTML

<script src="/pathto/transition.js"></script>

NPM

var Transition = require('/pathto/transition.js');

Call

Minimal

Transition.trigger({
    el: element, // DOM element
    classes: ['transition-type-start', 'transition-type-end']
});

Robust

Transition.trigger({
    el: element, // DOM element
    animationEl: subElement, // Another DOM element
    classes: ['transition-type-start', 'transition-type-end'],
    callback: function() {
        // run callback
    }
});

Examples

Found in examples/transition.html

You can’t perform that action at this time.