Jump to content
Search Community

won't start at the same time

Guest newdevide
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Guest newdevide
Posted

var why = document.getElementById("why");

var firstMenu = document.getElementById("firstMenu");

 

var secondMenu = new Array()

for(a=0; a<menuTeks.length; a++){

secondMenu[a] = document.getElementById("navTek_"+a);

}

 

var t1 = new TimelineMax();

t1.append([

new TweenLite(firstMenu, 3, {css:{left:ww-200, top:wh-40, opacity:1}, ease:Expo.easeOut}),

new TweenLite(why, 3, {css:{left:ww-160, top:wh-60, opacity:1}, ease:Expo.easeOut}),

new TweenLite(secondMenu[0], 2, {css:{opacity:1}}),

new TweenLite(secondMenu[1], 2, {css:{opacity:1}}),

new TweenLite(secondMenu[2], 2, {css:{opacity:1}}),

new TweenLite(secondMenu[3], 2, {css:{opacity:1}}),

new TweenLite(secondMenu[4], 2, {css:{opacity:1}})

])

 

the above is the script that i make. But the third animation and so on is run after the first two is completed. Why is that? Don't they supposed to run at the same time?

Oh and by the way. Is there a way to shorten the script for the third and above animations?

Posted

I think it is an illusion that the first 2 tweens start first because the ease:Expo.easeOut is a very strong ease and it move faster than the others at the beginning. remove the ease and see how it looks.

 

yes, you can tween a whole array of objects with 1 tween (new in v12)

 

TweenLite.to(secondMenu, 2 {css:{opacity:1}});

 

enjoy.

Guest newdevide
Posted

Carl, once again thx a lot man. You're right, the ease was the prob that cause it to run a bit late. One more question:

With the script that you gave me,

 

 

TweenLite.to(secondMenu, 2 {css:{opacity:1}});

 

Can i still put delay between each one of them? I tried putting delay:2. But it effected all of them.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...