oneiro Posted May 14, 2016 Share Posted May 14, 2016 How can I scale and translate a container simultaneously? I've tried three tweening libs (tweenjs, charm & tweenlite) - they all display the same result where it will either scale or translate the container (whichever is called first), but not both simultaneously. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 14, 2016 Share Posted May 14, 2016 That's strange. Everything should work. Demo code? Quote Link to comment Share on other sites More sharing options...
nmiguelmoura Posted May 14, 2016 Share Posted May 14, 2016 Hi, I use TimelineLite & TweenLite from Green Sock. For a 1 second animation, i would write something like this: var animation=new TimelineLite(); animation.to(container,1,{x:100,y:100}) .to(container.scale,1,{x:2,y:2,delay:'-1'}); Hope it helps Quote Link to comment Share on other sites More sharing options...
themoonrat Posted May 16, 2016 Share Posted May 16, 2016 By default, the tweens start playing after the last one has finished. If you want them to happen at the same time, you need to use the position parameter http://greensock.com/position-parameter For example, this sets the starting point for all tweens at time 0 of the timeline, which is what you require var animation=new TimelineLite(); animation.to(container,1,{x:100,y:100},0) .to(container.scale,1,{x:2,y:2},0); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.