diff --git a/jquery.transit.js b/jquery.transit.js index 561b49a..8d70451 100644 --- a/jquery.transit.js +++ b/jquery.transit.js @@ -206,6 +206,7 @@ // Allows you to rotate, scale and translate. registerCssHook('scale'); registerCssHook('translate'); + registerCssHook('translateZ'); registerCssHook('rotate'); registerCssHook('rotateX'); registerCssHook('rotateY'); @@ -355,6 +356,11 @@ if (y !== null && y !== undefined) { this._translateY = unit(y, 'px'); } this.translate = this._translateX + "," + this._translateY; + }, + + // ### translateZ + translateZ: function(z) { + this.translateZ = unit(z, 'px'); } }, @@ -367,6 +373,10 @@ return this._translateY || 0; }, + translateZ: function() { + return this.translateZ || 0; + }, + scale: function() { var s = (this.scale || "1,1").split(','); if (s[0]) { s[0] = parseFloat(s[0]); } @@ -409,6 +419,7 @@ if ((!support.transform3d) && ( (i === 'rotateX') || (i === 'rotateY') || + (i === 'translateZ') || (i === 'perspective') || (i === 'transformOrigin'))) { continue; } @@ -557,6 +568,9 @@ if (typeof duration === 'undefined') { duration = $.fx.speeds._default; } if (typeof easing === 'undefined') { easing = $.cssEase._default; } + // Disable animation + if ($.fx.off) { duration = 0; } + duration = toMS(duration); // Build the `transition` property.