Skip to content

Commit 81862be

Browse files
author
Brandon Burkett
committed
Added transform3d for chrome from this commit: rstacruz#199
1 parent 9afd9e4 commit 81862be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

jquery.transit.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
enabled: true,
4242

4343
// Set this to false if you don't want to use the transition end property.
44-
useTransitionEnd: false
44+
useTransitionEnd: false,
45+
46+
// enable to force chrome to use hardware acceleration
47+
use3dChrome: true
4548
};
4649

4750
var div = document.createElement('div');
@@ -165,7 +168,7 @@
165168
// forcing Chrome to not use the 3d transforms as well. Not sure if
166169
// translate is affectede, but not risking it. Detection code from
167170
// http://davidwalsh.name/detecting-google-chrome-javascript
168-
if (support.transform === 'WebkitTransform' && !isChrome) {
171+
if (support.transform === 'WebkitTransform' && (!isChrome || $.transit.use3dChrome)) {
169172
elem.style[support.transform] = value.toString(true);
170173
} else {
171174
elem.style[support.transform] = value.toString();
@@ -727,7 +730,7 @@
727730
// toMS('fast') => $.fx.speeds[i] => "200ms"
728731
// toMS('normal') //=> $.fx.speeds._default => "400ms"
729732
// toMS(10) //=> '10ms'
730-
// toMS('100ms') //=> '100ms'
733+
// toMS('100ms') //=> '100ms'
731734
//
732735
function toMS(duration) {
733736
var i = duration;

0 commit comments

Comments
 (0)