8000 Fix Opera issue with chained transitions. Closes #1. · f2er/jquery.transit@6c159e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c159e2

Browse files
committed
Fix Opera issue with chained transitions. Closes rstacruz#1.
1 parent 826e72e commit 6c159e2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

jquery.transit.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,20 @@
408408
}
409409

410410
if (typeof callback === 'function') callback.apply(self);
411-
if (typeof nextCall == 'function') nextCall();
411+
412+
// Defer execution of next call. It may trigger another CSS transition,
413+
// in which case Opera can screw up when it's executed in the same
414+
// JavaScript 'tick'.
415+
if (typeof nextCall === 'function') window.setTimeout(nextCall, 0);
412416
};
413417

414418
// Use the 'transitionend' event if it's available, then fallback to timers.
415419
if ((i > 0) && (transitionEnd)) {
416420
bound = true;
417421
self.bind(transitionEnd, cb);
418422
} else {
419-
// Durations that are too slow will get transitions mixed up. (Tested on Mac/FF 7.0.1)
423+
// Durations that are too slow will get transitions mixed up. (Tested
424+
// on Mac/FF 7.0.1)
420425
if ((isMozilla) && (i < 25)) i = 25;
421426
window.setTimeout(cb, i);
422427
}

0 commit comments

Comments
 (0)
0