Jump to content
Search Community

ZachSaucier last won the day on October 22 2023

ZachSaucier had the most liked content!

ZachSaucier

Moderators
  • Posts

    7,502
  • Joined

  • Last visited

  • Days Won

    202

Community Answers

  1. ZachSaucier's post in Is there a way to translate the x: value a number of times using repeat? was marked as the answer   
    There could be a more GSAP way to do it, but this can be done by looping it inside of a for loop as opposed to using the repeat attribute:
    var currX = 50,     tl = new TimelineMax(); for(var i = 0; i < 4; i++) {   tl.to(".red", 1, {x:currX})     .to(".blue", 1, {x:currX});   currX += 50; }
    See the Pen EPoJBx by Zeaklous (@Zeaklous) on CodePen
     
    This may be the only way due to the fact that the value of the tos cannot be changed on repeat (i.e. new Tweens have to be created).
×
×
  • Create New...