heygrady / transform

jQuery 2d transformation plugin
437 stars 87 forks source link

chained animate calls not working with scale #14

Closed ZevanRosser closed 13 years ago

ZevanRosser commented 14 years ago

In chrome 7 (and I suspect other browsers) if you chain animate calls using the scale property only the first animate call is run:

$(this).animate({scale : 1.5}, "slow").animate({scale : 1}, "slow");

The chrome javascript console shows the following error:

Uncaught TypeError: Cannot read property '1' of null

I downloaded the source for the plugin and the issue doesn't seem to be there... although scale only seemed to scale things on one axis, so I had to use scaleX and scaleY.

heygrady commented 14 years ago

you can send in both x and y at once. I'm currently working on that bug. It's a matter of finding a clean and simple way to handle multiple properties.

$(this).animate({scale : [1.5, 1.5]}, "slow").animate({scale : [1, 1]}, "slow");
ZevanRosser commented 14 years ago

thanks! that works nicely as long as I use version 0.9.0