What about older browsers?
Transit degrades older browsers by simply not doing the
transformations (rotate, scale, etc) while still doing standard CSS
(opacity, marginLeft, etc) without any animation. Delays and
durations will be ignored.
// Delegate .transition() calls to .animate()
// if the browser can't do CSS transitions.
if (!$.support.transition)
$.fn.transition = $.fn.animate;
Fallback to frame-based animation
If you would like to fallback to classic animation when transitions aren't supported,
just manually redefine .transitition
to .animate
.
(Note: if you're using custom easing, you may need to also use jQuery Easing, and restrict
your use of easing options to the ones defined there.)
$.fx.speeds._default = 300;
Default duration
Transit honors jQuery's default speed, $.fx.speeds._default
.
$.cssEase['bounce'] =
'cubic-bezier(0,1,0.5,1.3)';
$('.box').transition({ x: 0 }, 500,
'bounce');
Custom easing
Define custom easing aliases in $.cssEase
.
.box {
-webkit-backface-visibility: hidden;
}
Webkit: prevent flickers
Having flickering problems in Webkit? Use
-webkit-backface-visibility
. See this
question for some discussions on this.
.box {
-webkit-transition: translate3d(0,0,0);
}
Antialias problems in Webkit?
Force hardware-acceleration in Webkits to prevent text flickering. See
this article and
this article for more
information.