Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/herrmannplatz/jquery.motionevents
jQuery plugin to provide shorthands for transition and animation events
https://github.com/herrmannplatz/jquery.motionevents
Last synced: about 2 months ago
JSON representation
jQuery plugin to provide shorthands for transition and animation events
- Host: GitHub
- URL: https://github.com/herrmannplatz/jquery.motionevents
- Owner: herrmannplatz
- License: mit
- Created: 2015-08-16T19:52:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-19T15:14:09.000Z (over 9 years ago)
- Last Synced: 2024-10-09T23:06:17.023Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jQuery Motion Events Plugin
Shorthands for transtion and animation events.
Usage
------You can subscribe to 'transtionend', 'animationstart', 'animationiteration' and 'animationend' events by calling a function with the same name on your jquery element.
NOTE: Return `true` will dispose the event subscription.
```javascript
$('div').transitionend(function(e) {
// do some stuff
return true;
});$('div').animationend(function(e) {
// do some stuff
return true;
});
```To listen to a specific transition, e.g. when using multiple properties, provide an object with the properties as keys.
```javascript
$('div').transitionend({
opacity: function(e) {
// do some stuff
return true;
},
color: function(e) {
// do some stuff
return true;
}
});
```Same applies for animations. Just specify the animation name in the object passed to the function. This might be useful when you use different animations to create one big animation.
```javascript
$('div').animationend({
fadein: function(e) {
// do some stuff
return true;
},
fadeout: function(e) {
// do some stuff
return true;
}
});
```