Hi
I have a landing page animation that i want to start after all the images and files have been downloaded.
So... my js file looks like this
window.onload = function() {
var main = new TimelineMax({paused:true});
main.set($('.main__content'), {visibility: "visible"})
.from($('.main__content img'), 0.3, {autoAlpha: 0, scale: 0, ease: Power4.easeOut})
.staggerFrom($('.main__content h1 span'), 0.3, {autoAlpha: 0, ease: Power4.easeIn}, 0.15, 0)
.from($('.main__content p'), 0.3, {autoAlpha: 0, ease: Power4.easeOut})
.from($('.main__content .call-to-action'), 0.3, {autoAlpha: 0, y: 50, ease: Power1.easeOut})
.from($('.main__social'), 0.3, {autoAlpha: 0, ease: Power4.easeOut})
.add('headerIn');
main.play();
};
and the '.main__content' has visibility : hidden in the css file
when the page loads, the main__content remains hidden... and the animation is not seen...
Any ideas what could be wrong.
If i remove the gsap code from the window.onload function, it works fine, but i prefer to have the images load first.
Many thanks!