Skip to content

Commit

Permalink
Added transform3d for chrome from this commit: rstacruz#199
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Burkett committed Jul 17, 2014
1 parent 9afd9e4 commit 81862be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jquery.transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
enabled: true,

// Set this to false if you don't want to use the transition end property.
useTransitionEnd: false
useTransitionEnd: false,

// enable to force chrome to use hardware acceleration
use3dChrome: true
};

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

0 comments on commit 81862be

Please sign in to comment.