Jump to content
Search Community

Move 3 element at sameinterval

pipitt05000 test
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

Hi everybody ! :D

 

I need help:

I have 3 blocks (Bloc_1, Bloc_2, Bloc_3) and i set for all "alpha: 0".

 

Now, i want to set "alpha: 1" to three bloc, but with 0.5 secondes interval (for exemple).

 

I must write 3 "to" ? Or in one function with an attribute i can do this ?

 

 

Sorry for my bad english, i'm French, but i learn ! :D

 

Thanks you for your help ;)

Link to comment
Share on other sites

Hello pipitt05000, and Welcome to the GreenSock Forum!

 

Do you have a code example or a codepen demo example? this way we can help you better by seeing your code.

 

 

Also you can use the position parameter to allow your 3 blocks to play at the same time.

.to( target, duration, vars, position )

And a how to video by GreenSock:

 

 

Thanks!

 

:)

Link to comment
Share on other sites

Hi ! Thank you for your short reply !! :D

With the second video, i can do this ! Very helpful ! ;)

 

I have another question:

 

353374Sanstitre.png

 

I have 2 bloc and the first (Bloc_1) become hided.

How can i put the bloc_2 (Blue cross) at the bloc_1 (Red cross) position ? :D

    var tlBloc = new TimelineMax({
        repeat: -1,
        repeatDelay: 5
    });
    
    tlBloc.to(Bloc_1, 1, {
        delay: 2,
        alpha: 0
    })
    .to(Bloc_2, 1, {
        delay: 0.3,
        y: ??????
    });

Thank youuu !! :D

Link to comment
Share on other sites

The reason i asked for a codepen so this way we can see what your html, css, and js look like.

 

I really cant go by your image, since i have no idea where Bloc_1 is within your HTML markup. How many pixels down from where ever it is placed. Does it have position absolute or relative? Is it being positioned with transforms?

 

So a codepen demo will be helpful in understanding in context. :)

  • Like 3
Link to comment
Share on other sites

Back to your original question, I think perhaps a TweenMax.stagger() or staggerFrom() will help you like: 

http://greensock.com/stagger

 

In a timeline:

https://codepen.io/GreenSock/pen/JwfvL?editors=0010

 

I agree with Jonathan, there isn't much we can do from an image. It really helps to see a CodePen demo.

There is no way for us to guess what the y value will be.

  • Like 3
Link to comment
Share on other sites

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...