Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
mikecorbridge

modules

Recommended Posts

This question has probably been asked, but my searches have not turned up anything of value yet.

 

Basically I have an animation sequence that will be used on multiple timelines.  Is there a way to 'package' a unique timeline and apply it to others?  An example I might come up with is the flapping of a birds wings (I'm not writing that btw).  The sequence I might use to flap the wings could be generally applied to a number of wing images, and bird bodies.  

 

Apologies in advance if this noob question has already been addressed. 

Share this post


Link to post
Share on other sites

Hi mikecorbridge  :)

 

pls try this : 

See the Pen OPeqVR by MAW (@MAW) on CodePen

function anim(elem){  
  var tl = new TimelineMax();
  tl.to(elem,1,{.............})
    .to(elem,1,{........})
  return tl
};

var master1 = new TimelineMax();
master1.to( '#mydiv1' , 0.5 , {rotation:360})
  .add( anim( '#mydiv1' ) ) // now you can call anim() with any selector and add in other timelines
  .add( anim( '#mydiv2' ) ); 
  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×