I have a banner that runs a quick GSAP driven animation as well as a JS based countdown timer.
//edited to include link
http://codepen.io/anon/pen/XXddLq
GSAP code
var tl1 = new TimelineMax ();
tl1.from("#myAdHero", 1, {ease:Sine.easeInOut, autoAlpha:0, delay: 1})
.from("#myAdLogo", 1, {ease:Power3.easeInOut, autoAlpha:0, delay: .25})
.from("#timer", 1, {ease:Sine.easeInOut, autoAlpha:0})
.from("#myAdCTA", 1, {ease:Power3.easeInOut, autoAlpha:0})
.from("#myAdBar", 1, {left: "-300", ease:Power1.easeInOut})
.from("#myAdTxt1", .5, {ease:Power2.easeIn, autoAlpha:0})
.to("#myAdTxt1", .5, {autoAlpha:0}, "+=3")
.from("#myAdTxt2", .5, {ease:Power2.easeIn, autoAlpha:0})
}())
When the countdown reaches a specified date the timer would just no longer remain visible.
This is the code in that makes the timer <div> disappear ( I didn't include all of the code because I didn't think it was necessary)
if (time[1] <= 0) {
clearInterval(interval_id);
document.getElementById('timer').style.display = 'none';
}
Everything works great at this point but now, what I need to do, is move my button over and revise the copy with a different message. All of my lines of copy are in my sprite sheet.
So, I was wondering, if I created an alternate timeline, could I use the above if/then to run it in place of the TL1 timeline and if so, how would I go about doing it? I'm really not well versed in JS.