Skip to content

transitionEnd events firing more than once #1

@GeoTimber

Description

@GeoTimber

Hello

I noticed that in Chrome the transitionEnd events fire more than once though I can clearly you see tried to make it fire once.

      complete = function(element) {

        return element.one(transitionEnd, function() {
          return callback(element);
        });

Why does it fire more than once? i have no clue, and find it odd.

I had to make sure the callback only fired once bying add this to the callback

      callback = function(element) {
        if (settings.infinite === false) {
          element.callOnce=true;
          if (element.callOnce) {
              element.callOnce=false;
              element.off(transitionEnd);
          }
              removeClass(element);
        }
        if (typeof settings.callback === 'function') {
          return settings.callback.call(element);
        }
      };

Hope this helps someone, thanks for making and publishing this script!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions