Code Monkey home page Code Monkey logo

transitionend's Introduction

TransitionEnd

TransitionEnd is an agnostic and cross-browser library to work with event transitionend.

Browser Support

Chrome Firefox Internet Explorer Opera
1.0+ ✔ 4.0+ ✔ 10+ ✔ 10.5 ✔ 3.2+ ✔

Installation

To install Selecting, execute:

  npm install transitionEnd

Or Bower too:

  bower install transitionEnd

Or simply pick up the file from src directory.

Methods

  • transitionEnd(element).bind(callback)
  • transitionEnd(element).unbind()
  • transitionEnd(element).whichTransitionEnd()

How does it work?

var box = $("#box"); // or document.getElementById("box")
var foo = $("#foo");

transitionEnd(box).bind(function(){
	foo.addClass("on");
	transitionEnd(box).unbind();
});

var transition = transitionEnd(box).whichTransitionEnd(); // return for example "webkitTransitionEnd"

transitionend's People

Contributors

anselmbradford avatar dependabot[bot] avatar evandrolg avatar zauberfisch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

transitionend's Issues

TransitionEnd did not fire for IE11

I have problem to trigger transitionEnd for IE. I believe IE use the transitionend instead of transitionEnd
transintionend_poly.js

line37: 'transition': 'transitionEnd',

then after I changed it to

'transition': 'transitionend',

It starts to work for IE. Any ideas?

Not working in Opera 38

It seems like this polyfill doesn't work properly with Opera 38. It detects that it should be using webkitTransitionEnd but that event never fires (only transitionend does).

Use of Array.indexOf makes IE8 go sour.

First of all, thanks for a great and focused tool I really needed. :)

In transitionEnd_full.js line 83 you use Array.indexOf, which IE8 does not have by default.

If you want IE8 to continue execution after that line, either use a polyfill like this:

Array.prototype.indexOf = function(obj, start) {
     for (var i = (start || 0), j = this.length; i < j; i++) {
         if (this[i] === obj) { return i; }
     }
     return -1;
}

or rewrite line 83:

positonElement = this.list.indexOf(element);

to something like:

positonElement = -1;
for (var i=0; i < this.list.length; i++) {
    if (this.list[i] === element) {
        positonElement = i;
        break;
    }
}

Two questions...

Hi, great little utility you have here. I have two questions:

  1. Can you list browser support in the readme? It's not immediately clear how far back the support goes in IE. Some polyfills only support unifying the event but not older browsers. What is the support for this one?

  2. Is it possible to publish this on npm? Would love to use it and manage updates through our npm ecosystem setup in the project.

Thanks for your hard work on this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.