Hi. I would like to add class to my element when animation started, and remove class when animation is completed.
var tl = new TimelineLite();
tl.from('#heroPreloader', 2, {onStart: onStart, onComplete: onComplete})
.from('#heroContent', 3, {autoAlpha: 0});
function onStart() {
tl.set('#heroPreloader', {className: '+=preloader_show'});
}
function onComplete() {
tl.set('#heroPreloader', {className: '-=preloader_show'})
}
But nothing is happened. Class not adding and not removing. Anyone tell me why?