jQuery Preloader Animation

I want to “preload” the start page of my website with a little gif-animation. Its a 3-frame-piece and I want to show it right before the first page. Are there plugins to preload a page with a specific animation shown?

Related posts

Leave a Reply

1 comment

  1. You don’t need a plugin, or even jQuery. Just assign the image to a variable in the <script> block in the <head> of your page. JavaScript prevents the content from loading until it has done it’s job, so the image will already be cached by the page visitor when the HTML is rendered:

    <head>
      <script>
        var animation = new Image();
        animation.src = "images/animation.gif";
      </script>
    </head>
    
    <body>
      <div>
        <img src="images/animation.gif" alt="oooh! lookee!"/>
      </div>
    </body>