So I have some animations that need to happen before the page content shows up.
I'm using JS to hide the divs that I want to appear on load with an animation, but because the script file is being called after the HTML, the divs appear, disappear when the JS happens, and then appear again with the animation.
My problem is that when I put the script file in the beginning, the hiding doesn't happen, probably because the divs it's targeting don't exist yet.
Is there a way that I can load the jQuery file first and then hide the divs as soon as they exist but before they're finished loading?
PS: If I use css to hide the divs it won't work when javascript is disabled, which is a problem, and if I just use JS to switch classes I have the same problem with the delay, and it looks glitchy...