Good day dear community.
Can't resolve a problem.
I wanna add tween to timeLine animation. It works.
It will be an animation cosist of multiple sub-animations, that will be performed in parallel.
But.
Chrome shows me the error:
I can't understand what's happened.
Please advice me.
What am i doing wrong?
<div class="section-3">
<span id="dots">
<span></span>
<span></span>
<span></span>
</span>
</div>
var b3Text = $("#dots");
var tl3 = new TimelineMax({paused: true});
function spin(elem) {
$(elem.find("span")).each(function(i) {
TweenMax.to($(this), 2.5, {
x: randomWithBounds(0, $(this).parent().parent().width() - 10),
y: randomWithBounds(0, $(this).parent().parent().height() - 10),
delay: i + 2,
rotationX: 360,
ease: Power1.easeInOut,
onComplete: function() {
spin(elem);
}
}, 0.1);
})
}
tl3.to(spin(b3Text), 1,
{
repeat: -1,
repeatDelay: 0.5
});
tl3.play();