Thanks so much for all the info. Glad to take credit for .progress being a clever approach . But the more experience I gain the more I realize that's where I often get into trouble... The trick is learning to recognize when clever becomes too clever.
And I thought that progress bit seemed a little too easy...
Anyway, I also agree that the viewbox multiplying by 2 thing is strange. In my other tests I was explicitly defining (rather than calculating) dimensions and didn't have any issues there. It was only in these reduced test cases I ran into things only calculating half the dimension. Not obvious to me why that is, (I guess because the zero coordinate is centered?) but doesn't seem too important.
One last question to add a bit of complication.
Let's say each particle doesn't have a hard coded 20 x 20 dimension, but is instead randomized. Your example has that dimension pre-set in the wrap function, which obviously wouldn't work.
Is there any way to access the properties of each object inside the animateParticles function? And then maybe pass the unique dimension into the wrap function?
Something like
function animateParticles() {
animation = TweenMax.to(".box", 2, {
x: "+=1000",
ease: Linear.easeNone,
onComplete: animateParticles,
modifiers: {
x: wrapPartial((target.width * -1), 1000)
}
});
}