Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation Listener #5

Open
mag1ster opened this issue Nov 5, 2015 · 0 comments
Open

Animation Listener #5

mag1ster opened this issue Nov 5, 2015 · 0 comments
Labels

Comments

@mag1ster
Copy link
Collaborator

mag1ster commented Nov 5, 2015

    /*
     * Cross-Browser (IE9+) Listen to animation and fire a callback function when completed
     * @param object element : DOM Element
     * @param string type : Type of event to watch
     * @param function callback : Function to be Called after complete
     */
    animationListener : function(element, type, callback){
        var pfx = ["webkit", "moz", "MS", "o", ""]; //All prefix that must be listened
        for (var p = 0; p < pfx.length; p++) {
            if (!pfx[p]) type = type.toLowerCase();
            element.addEventListener(pfx[p]+type, callback, false);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant