Hi, after downloaded the v.12 and simplifing the function inside the bouncing_ball.html file (inside the example folder) I can see a variable (originally an array) that is needed to play the animation.
(function() {
var ball = document.getElementById('ball'),
colors = "";
function play()
{
ball.style.marginLeft = "0px";
var tl = new TimelineLite({delay:0.5});
tl.to(ball, 0.5, {css:{marginTop:0}})
.to(ball, 1, {css:{marginLeft:"+=450px"}, ease:Bounce.easeOut})
.to(ball, 1, {css:{marginLeft:0}, ease:Quint.easeOut}, 1)
.call(play);
}
play();
})();
I can't understand why if I remove this variable the animation it doesn't work. Originally the variable it was an array:
colors = ["#480e6e","#fc4239","#ffd400","#00c4df"];
that tl timeline it was using to change the color of the ball in this way:
.to(ball, 1, {css:{marginLeft:0, backgroundColor:colors[ Math.floor(Math.random() * colors.length) ]}}, 1)
It sounds a bit strange... May you help me?
Thanks!