Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uiur/animationend

Detect when CSS animations have ended
https://github.com/uiur/animationend

Last synced: 3 months ago
JSON representation

Detect when CSS animations have ended

Awesome Lists containing this project

README

        

# animationend
[![npm version](https://badge.fury.io/js/animationend.svg)](http://badge.fury.io/js/animationend)
[![Build Status](https://travis-ci.org/uiureo/animationend.svg?branch=master)](https://travis-ci.org/uiureo/animationend)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/uiureo-animationend.svg)](https://saucelabs.com/u/uiureo-animationend)

Detect when CSS transitions/animations have ended. Cross-browser tested.

The function returns ES6 Promise.

``` javascript
var animationEnd = require('animationend')

var element = document.getElementById('id')
animate(element)

animationEnd(element).then(function(event) {
// called on transitionend or animationend
})

animationEnd(element, function(event) {
// also you can use a normal callback
})
```

## Installation
```
npm install --save animationend
```

## License
MIT