Jump to content
Search Community

Simple question on animating out a tagline/whatever

lasadorian test
Moderator Tag

Go to solution Solved by Carl,

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

basically i followed the new video on lynda whcih was great!.

 

But i am trying to figure out a simple way to animate out of screen an element.

 

 
var tl1 = new TimelineMax();
 
tl1.to('#myAd', .4, {opacity: 1})
.from('#myAd_yellowtab', 2.2, { left: -80, ease: Power2.easeOut }, '-=.5')
.from('#myAd_tagline1', 3, { opacity: 0, left: -180, ease: Power4.easeOut, }, '-=2.6')
.from('#myAd_tagline2', 3, { delay:2, opacity: 0, left: -180, ease: Power4.easeOut }, '-=3.6')
.from('#myAd_tagline3', 3, { delay:4, opacity: 0, left: -380, ease: Power4.easeOut,  }, '-=3.6')
.from('#myAd_cta', 1.3, { opacity: 0, top: 300, ease: Back.easeOut.config(1.7) }, '-=1.8');
 
so both tagline 1 and 2 tween into the scene then i want them to tween out.
 
I'm not sure how to attack that in a simple manner.. reverse? yoyo? when i tried to just make another line of code nothing happend.
 
any help?
Link to comment
Share on other sites

  • Solution

A very simple CodePen demo would really help, but for now I can only suggest you use a to() to tween them to another position

 

 

.from('#myAd_tagline1', 3, { opacity: 0, left: -180, ease: Power4.easeOut, }, '-=2.6')
.from('#myAd_tagline2', 3, { delay:2, opacity: 0, left: -180, ease: Power4.easeOut }, '-=3.6')
 
.to('#myAd_tagline1', 3, { opacity: 0, left: 300, ease: Power4.easeOut, }, '+=1')
.to('#myAd_tagline2', 3, { delay:2, opacity: 0, left: 300, ease: Power4.easeOut }, '+=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...