Jump to content
Search Community

Animation images and text

Mary Pieroszkiewicz test
Moderator Tag

Recommended Posts

Hey Mary and welcome to the GreenSock forums! 

 

Unfortunately we don't have the capacity to create every effect that people request here in the forums for them. If you need help with a specific part of your project, can you please create a minimal demo as described in the thread below? Using CodePen and isolating only the relevant parts of your code would make it more more likely that you'll get a response from this forum:

 

  • Like 1
Link to comment
Share on other sites

I'd use a GSAP timeline. Have your text in the DOM and then do the same animation for both sets. Using a timeline will automatically sequence the animations one after another. 

 

The basic setup I'd use is something like this:

See the Pen wvapNdG?editors=0010 by GreenSock (@GreenSock) on CodePen

 

If you have more than a couple of sets of words, it might be worth creating a GSAP effect and using that + looping to make it easier to understand and more maintainable. 

 

I highly recommend reading our Getting Started article, the post on creating smarter animations, and the article on the position parameter:

https://css-tricks.com/writing-smarter-animation-code/

 

Happy tweening!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hey @Mary Pieroszkiewicz. Images can be treated exactly like other elements! GSAP doesn't care that they're images, it will move them around as you tell it to. 

 

Unfortunately we don't have the capacity to complete each step of your project. Please read the information above, try it yourself, and if you have a specific question then please ask. 

  • Like 1
Link to comment
Share on other sites

7 minutes ago, Mary Pieroszkiewicz said:

I can't change image...

What do you mean "change the image"? Do you mean animate the image using GSAP? If so, you should probably pass the selector text for the image (either the img element or the figure depending on what you're wanting to animate) to a new GSAP tween.

 

If you mean changing out the image for a different one, that's a whole different question.

  • Like 1
Link to comment
Share on other sites

13 minutes ago, Mary Pieroszkiewicz said:

I can't set the last element like in the video

Thanks for the updated demo. What do you mean "set"?

 

It looks like you started using the old format for duration, putting in its own parameter instead of within the vars parameter like we suggest doing. I highly recommend that you read through our Getting Started article that I linked to above. It has the most up to date formatting and will teach you step by step how to do things. 

 

Also note that you don't have to pass in an element reference to the tweens, you can just pass in the selector string like I have been doing.

Link to comment
Share on other sites

  • 10 months later...
57 minutes ago, Mary Pieroszkiewicz said:

Why doesn't work the animation - ball and device.

The animation is working! But you can use your developer tools to see that the images' heights are 0px tall so you can't see them. This is because you have position: absolute but didn't declare a height. Maybe you want something like height: 100% on .anim__img?

  • Like 1
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...