I'm making a page for a friend that has an animated gif when you click a link. clouds swoop in and the page redirects. When the page redirects the clouds (another gif) disperse. Due to caching issues I had to add a random ID to each instance of the gif thus slowing my site down.
I have my page redirect on a timer right now yet with poor internet the gif of clouds coming in is often is cutshort making it look really awkward when the page redirects and is covered in clouds. If needed I can link the page.
How can I check to see if my animation has finished before redirecting or taking other action?