Permalink
Browse files

Fixing scales in Chrome

We've seen the 3D version of Scale() not work in Chrome when the
element being scaled extends outside of the viewport.  Thus, we're
forcing Chrome to not use the 3d transforms as well.  Not sure if
translate is affected, but not risking it.
  • Loading branch information...
1 parent ed47e19 commit a7ba4c99d5b40d734660044f89b8b711d2712020 @weotch committed Jan 17, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 jquery.transit.js
View
@@ -100,7 +100,11 @@
if (!(value instanceof Transform))
value = new Transform(value);
- if (support.transform == 'WebkitTransform')
+ // We've seen the 3D version of Scale() not work in Chrome when the element being scaled extends outside of
+ // the viewport. Thus, we're 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
+ var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
+ if (support.transform == 'WebkitTransform' && !is_chrome)
elem.style[support.transform] = value.toString(true);
else
elem.style[support.transform] = value.toString();

0 comments on commit a7ba4c9

Please sign in to comment.