Jump to content
Search Community

hgl

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by hgl

  1. OSUblake, thanks for the help.

     

    Unfortunately, in my case, the before and after elements can't be absolutely positioned.

     

    Inspired by your code, I give it another try, and this time I simply wrap tweens in functions, and return a new one whenever I need an animation, seems to be working. Not sure if I'm wasting memories?

     

    See the Pen gpmzBm by anon (@anon) on CodePen

  2. I'm experimenting with GSAP, and I have a few questions regarding the pen I created:

     

    1. How do I reuse tweens? In the demo, if I alternatively click toggle and yoyo (and clicking yoyo after the page is firstly loaded doesn't seem to work), the animation breaks easily.
    2. The two tweens I created actually cancel each other. Is it possible to define one as a reversed version of the other? Note that they have to modify a class.

     

    Thanks in advance.

    See the Pen eNvRJg by anon (@anon) on CodePen

×
×
  • Create New...