Skip to content

Commit

Permalink
Fixing scales in Chrome
Browse files Browse the repository at this point in the history
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
weotch committed Jan 17, 2012
1 parent ed47e19 commit a7ba4c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jquery.transit.js
Expand Up @@ -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();
Expand Down

0 comments on commit a7ba4c9

Please sign in to comment.