Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions jquery.transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
// Will simply transition "instantly" if false
enabled: true,

// Use 3d transform
use3dTransform: true,

// Set this to false if you don't want to use the transition end property.
useTransitionEnd: false
};
Expand Down Expand Up @@ -166,7 +169,7 @@
// translate is affectede, but not risking it. Detection code from
// http://davidwalsh.name/detecting-google-chrome-javascript
if (support.transform === 'WebkitTransform' && !isChrome) {
elem.style[support.transform] = value.toString(true);
elem.style[support.transform] = value.toString($.transit.use3dTransform);
} else {
elem.style[support.transform] = value.toString();
}
Expand Down Expand Up @@ -434,8 +437,9 @@

for (var i in this) {
if (this.hasOwnProperty(i)) {
// Don't use 3D transformations if the browser can't support it.
if ((!support.transform3d) && (
// Don't use 3D transformations if the browser can't support it
// or if the use3dTransform option is false.
if ((!support.transform3d || !$.transit.use3dTransform) && (
(i === 'rotateX') ||
(i === 'rotateY') ||
(i === 'perspective') ||
Expand Down
2 changes: 2 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ <h1>jQuery transit tests</h1>

<div class='tests'></div>
<script>
// $.transit.use3dTransform = false;

group('Transformations');

test('Translation', function($box) { $box.transition({ x: 20, y: 20 }); });
Expand Down