https://github.com/pixelunion/jquery.trend
Fail-safe TransitionEnd event for jQuery.
https://github.com/pixelunion/jquery.trend
library
Last synced: over 1 year ago
JSON representation
Fail-safe TransitionEnd event for jQuery.
- Host: GitHub
- URL: https://github.com/pixelunion/jquery.trend
- Owner: pixelunion
- License: mit
- Created: 2014-12-05T00:24:53.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2021-04-22T17:21:23.000Z (about 5 years ago)
- Last Synced: 2024-04-26T20:48:56.709Z (about 2 years ago)
- Topics: library
- Language: JavaScript
- Size: 4.88 KB
- Stars: 6
- Watchers: 25
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery.trend
Fail-safe TransitionEnd event for jQuery.
Adds a new `trend` event that can be used in browsers that don't support
`transitionend`.
It works by parsing an element's `transitionDuration` and `transitionDelay`
properties and using `setTimeout` as a fallback. Because of this, Trend can only
be used with `jQuery.one`.
## Usage
```css
.some-element {
opacity: 0;
transition: opacity 1s ease 200ms;
}
.some-element.active {
opacity: 1;
}
```
```js
var el = $(".some-element");
el.addClass("active");
el.one("trend", function(e){
// Called approx 1200ms later
});
```