Hello,
I just started to animate a gradient using colorprops, but I have a little issue.
Here's my syntax :
var iconAnim = new TimelineMax();
var lineColor = {bg: "rgba(255, 255, 255, 0)"};
iconAnim.to(lineColor, 2, {colorProps:{bg: "rgba(255, 255, 255, 1)"}, onUpdate:colorizeLine,
onUpdateParams:["#icones"]});
function colorizeLine(element) {
TweenLite.set(element, {background: 'linear-gradient(to top, transparent 48%,' + lineColor.bg
+ ' 1%, transparent 49%)'});
}
This is working one time. The function get called and the correct first step in getting my alpha up is working. I logged to the console the value of lineColor.bg and got correctly all the rgba() value set during the 2 seconds.
But despite calling my colorizeLine() function, it's only applied on the first time.
Do you have any idea why?
Kind regards.