Get $500+ of the best After Effects files, video templates and music for only $20!

jQuery Plugin: Preload Images

Cost: Free, links back
Found Via: www.filamentgroup.com

Today, I came across a great jQuery plugin that will preload your images. This file now has a permanent spot in my “resources” folder. The plugin essentially scans your CSS files and preloads all of the images within it.

Image Preloader Plugin

Add Comment

Discussion 22 Comments

  1. Great plugin. Just in time for me to add it to a new site I’m designing

    • jQuery says:

      Great plugin and code but it downloads images from CSS file. I needed to preload images using jQuery to insert them into the DOM. This article describes it very nicely.

      I hope it will help some who came here using google :)

      Thanks for this plugin, I will probably use it in my next project.

  2. Ben says:

    That’s crazy… I googled this YESTERDAY and now you guys have a post on it. Bookmarked.

  3. RocyHua says:

    Really Cool effect.

  4. Lamin says:

    Thanx for sharing

  5. Eduardo says:

    Great Plugin

  6. David says:

    That’s great – thank you. Say – care to share what else is in your ‘resources’ folder?! I’m always interested to learn peoples basic file structure when setting up a new project … !

  7. Ben Reid says:

    I’ve followed the steps to install it and I’m familiar with jQuery but I can’t see it working on my page.

    I have a header that has a .jpg that’s about 11kb ( it’s assigned using ‘background-image’ in the css and is repeated across the x axis ) in size but I still see the ‘flickering’ as it’s being loaded.

    Should the plug-in show the entire repeated section of image(s) in one go, once preloaded?

    Even navigating away from the page and coming back to it makes no difference.

    Any help would be nice. :)

  8. For some reason I thought that css referenced images were automatically preloaded when the css file gets loaded into the browser.

    Thought this was one of the factors in using css rollovers instead of javascript rollovers.

    Wonder where i got that from. :S

  9. ahh i remember now.
    css rollovers have both images loaded anyway with the top image (off state) placed over the background image (on state) using css.
    so its a kind of fake preloading.

    so not the same thing :)

  10. Chris says:

    @Ben Clear the cache on your browser and then use Firefox’s ‘Net’ menu to see if the image has been preloaded.

    I use the following plugin for my preloading:

    http://flesler.blogspot.com/2008/01/jquerypreload.html

  11. AdrianMG says:

    I have posted a tutorial to preload js scripts and css with simple jqery and any plugins or 3rd lirabries. It is the same concepto behind the Gmail preloader:

    http://yensdesign.com/2008/11/how-to-create-a-stylish-loading-bar-as-gmail-in-javascript/

  12. John says:

    Very nice, just what I’ve been looking for infact

  13. kareem says:

    this is wonderful tutorial i will put acopy of this lesson on
    my site here
    http://www.as7ap4you.com

  14. dams says:

    omg GREAT! im searching for this!.
    olny in nettuts!.

  15. Ian says:

    jquery is great d00dz

  16. It’s the very thing i want to catch. Thanks!

  17. ashton says:

    Does anyone know how they got that loading page done?? cant seem to figure it out..

    Thanks in advance

  18. Ginva says:

    Which better, Preload image using javascript or CSS?

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.