Hey guys,
I'm new to GSAP and was wondering if there's an easy solution to start the timeline AFTER all assets/images have been loaded. Maybe even with a circular preloader e.g.
Thanks for your help
Hello hallibus, and welcome to the GreenSock Forum!
You could do this so your GSAP code only runs when the DOM is ready and the window has loaded:
// run preloader code here
...
// wait until DOM is ready
document.addEventListener("DOMContentLoaded", function(event) {
// wait until window is loaded - meaning all images, stylesheets, js, fonts, media assets, and links
window.addEventListener("load", function(e) {
// run all GSAP code here