I have this function:
function changeInfo(element){
new TimelineMax();
tl = new TimelineMax();
tl.to('.info-row .content', 0.3, {opacity: 0}, 0)
.add(insertContent(element))
.to('.info-row .content', 0.3, {opacity: 1}, 0.6)
//insertContent(element);
}
Which is fading out some content, run a function to insert the new content, and then fade in the new content.
The browser is returning "Uncaught Cannot add undefined into the timeline; it is not a tween, timeline, function, or string."
If I comment out the timeline and just run insertContent(element); it works fine (all be it without the animation obviously).
Any idea what I can do to fix this?
Cheers,