I have a CSS animation with sound, however, when the page initially loads, the sound is delayed. I would like a way to wait until everything on the page has loaded before I load the page. How can I do this? I found one script here: / but I was wondering if there was something even simpler.
I have a CSS animation with sound, however, when the page initially loads, the sound is delayed. I would like a way to wait until everything on the page has loaded before I load the page. How can I do this? I found one script here: http://css-tricks./snippets/jquery/display-loading-graphic-until-page-fully-loaded/ but I was wondering if there was something even simpler.
Share Improve this question asked Jan 31, 2013 at 14:57 JVE999JVE999 3,51712 gold badges61 silver badges96 bronze badges 1- I noticed the page you linked uses jQuery, but it's not specified above in the tags. Are you looking for a pure JavaScript solution? Also, please post any relevant code of your own in your post so we can see what you've tried. – Chase Commented Jan 31, 2013 at 15:01
1 Answer
Reset to default 3The link you provided is the simplest and best way to do this. No need to look for anything else.
<script>
// Wait for window load
$(window).load(function() {
// Animate loader off screen
$("#loader").animate({
top: -200
}, 1500);
});
</script>