How to force Bootstrap to use its transition.js
and jQuery animations, instead of CSS3 transition
? I use lot of animations, and it fails on iPad.
Asked
Active
Viewed 139 times
-2
-
"fails on iPad" Can you elaborate on that? – Mooseman Dec 17 '14 at 15:15
-
won't get much help without being a lot more specific – charlietfl Dec 17 '14 at 15:19
-
@Mooseman: OH! Page crashes then reloads. It's not related to question. I want to replace jQuery animation with transition. – mrdaliri Dec 17 '14 at 15:19
-
More information: http://stackoverflow.com/a/11833285/501134 – mrdaliri Dec 17 '14 at 15:21
-
@kikio Which is it? `CSS3 => jQuery` or `jQuery => CSS3`? – Mooseman Dec 17 '14 at 15:22
-
`CSS3 => jQuery` needed... – mrdaliri Dec 17 '14 at 15:23
1 Answers
0
A simple, albeit hackish, way to this would be to open transitions.js and replace
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
with
function transitionEnd(){ return false; }
If you're using minified Bootstrap, find the same function and replace its contents with return false;
.
This causes $.support.transition
to be set to false
, which causes Bootstrap to think the browser does not support CSS3 animations. BEWARE, however, as doing this will hurt performance on many devices.

Mooseman
- 18,763
- 14
- 70
- 93