Jump to content
Search Community

Eunomiac

Members
  • Posts

    14
  • Joined

  • Last visited

Community Answers

  1. Eunomiac's post in Possible to Define a Class Whose Objects Can Be Passed as Targets for GSAP Methods, Instead of an Element/Selector/jQuery? was marked as the answer   
    Well, that was certainly a lot easier than I expected! 
     
    I was about to ask some follow-up questions, then decided to see if I could answer them on my own, using the pens you posted as my guide. Here's the CodePen I ended up with.  I think it does a nice job of extending the pens you posted to class syntax, as well as showing that this also works with multiple objects animated in a single Tween, even with a stagger.  Perhaps someone like me might find it helpful down the road?
     
    I did have one question as I was working on it:  Are there any performance or best-practices issues with my use of gsap.set within the setters that will be targeted by the tween (e.g. set posX(x) { gsap.set(this.elem$, {x}) }?  I just want to confirm there aren't any recursion issues or other potential consequences of "nesting" gsap calls in such a way?
     

    See the Pen gOvRWNg?editors=0011 by eunomiac (@eunomiac) on CodePen
×
×
  • Create New...