Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion jquery.transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@
var self = this;
var delay = 0;
var queue = true;
var windowTimeout;

// Account for `.transition(properties, callback)`.
if (typeof duration === 'function') {
Expand Down Expand Up @@ -564,7 +565,7 @@
self.bind(transitionEnd, cb);
} else {
// Fallback to timers if the 'transitionend' event isn't supported.
window.setTimeout(cb, i);
windowTimeout = window.setTimeout(cb, i);
}

// Apply transitions.
Expand All @@ -591,6 +592,17 @@
// Use jQuery's fx queue.
callOrQueue(self, queue, deferredRun);

// Somethink like jQuery animation stop.
self.stop = function () {
if($.transit.useTransitionEnd) {
self.unbind(transitionEnd);
} else {
clearTimeout(windowTimeout);
}
self.removeAttr("style");
return self;
};

// Chainability.
return this;
};
Expand Down