ZachSaucier, I've tried to kill the animation and start it again, but that didn't worked to me.
I have declared in the global scope the variable named 'horizontalSlide' like that:
var horizontalSlide = new TimelineMax();
Then when page is loaded:
$(window).on('load', function() {
horizontalSlide.fromTo("#slideContainer", 10,
{
x: "0"
}, {
x: amount_to_scroll * (-1) + 'px',
ease: Linear.easeNone,
});
});
And then, when page resizes:
horizontalSlide.kill();
//TimelineMax.killTweensOf("#slideContainer");
horizontalSlide.fromTo("#slideContainer", 10,
{
x: "0"
}, {
x: amount_to_scroll * (-1) + 'px',
ease: Linear.easeNone,
});
That code does not work
Please, can you help me? How can I kill and start over the animation when window is resized?
THANKS!