IanY
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by IanY
-
-
When we want three tweens happen one by one, we can simply the code and write it as the following one.
new TimelineLite() .from('#elem-1', 1, { y: -100 }) .from('#elem-2', 1, { y: 100 }) .from('#elem-3', 1, { y: -100 })
But when we want three tweens happen at the same time, we have to add them in an array like the following code. Is there away to simply the code by omitting .add and TweeMax in this case?
new TimelineLite() .add([ TweenMax.from('#elem-1', 1, { y: -100 }), TweenMax.from('#elem-2', 1, { y: 100 }), TweenMax.from('#elem-3', 1, { y: -100 }) ])
-
Hi Jack. Thank you very much! You have answered my question.
-
I have seen the following codes, but can't really tell the difference between them. I know the usage of .staggerFrom; what I don't currently understand is why the portions before .staggerFrom varies.
new TimelineLite().staggerFrom(......) TweenMax.staggerFrom(......) TimelineLite.staggerFrom(......) TimelineMax.staggerFrom(......)
Shouldn't TweenMax, TimelineLite, and TimelineMax be added to new TimelineLite()? If so, why can new TimelineLite() itself concatenate a .staggerFrom(......) ?
How to simply the code which adds an array of tween?
in GSAP
Posted
Thanks all. Sorry for not being clear. I was just looking for a way to write less code so that my code looks cleaner.
And all elements' animating values are actually different. I shouldn't have made #elem-1 and #elem-3's animating values the same. Sorry about that.
It looks like both PointC and Shaun Gorneau answered my question. PointC's code is less; Shaun Gorneau's code is clearer. Thank you!