47 responses to “jQuery Image Preload Plugin”

  1. Reza

    thank u. this is very useful for me.
    but i think the ‘each’ part does not work correctly.
    i want to use it to make progress bar but i can t.
    can u help me?

  2. Taylor

    Wow, thank you so much! I have been looking for this plugin or the code to create it for hours.

  3. Michael DiSanto

    This plugin is exactly what I was searching for however I was unable to get the “all” callback function to fire in IE7. “each” works fine, but “all” was not called.

    Code was basically
    $(‘#content img’).imgpreload({
    each: function(){
    alert(‘!’);
    }.
    all: function(){
    alert(‘!’);
    }
    });

    Any ideas?

  4. Steven

    thanks a lot. Exactly what I was looking for

  5. George

    I’m trying to use this inside WordPress and I’m getting an error when I use it:

    $(“#randimg img”).imgpreload is not a function

    It works if I have my script and this plug-in in the body but doesn’t work if I load either or both my script and the plugin in . What am I doing wrong? Thanks.

  6. keun

    Very nice.

  7. YAACH

    Thanks..very useful..I still have a question.
    What if you want to load 20 images and you dont want to specify the path one by one. Is there a way you can load images with different paths BEFORE the DOM is built?

  8. guy

    I cant believe this is not a part of jquery. why not have in built in? (a la mootools Asset class). its was a real pain to find this plugin…

  9. philipp

    nice plugin. exactly what im looking for. thanks!

  10. Matthew Rath

    Brilliant! :p ive been looking for a decent image preloader for a while now to implement on my site as im currently building a new portfolio. This fits the bill exactly, the only thing i would take into consideration is YAACH’s comment, it would be nice to also have loop function within the class so u can just specify a directory an let it take care of the rest but ill attempt to add this in myself thanx again this is awesome :p

  11. Alexander Zaharakis

    Excellent work brother! Works a treat

  12. Edward Hotchkiss

    Hey, you can check out a great jQuery Preloader that I wrote with full callbacks, auto reading of images to preload, and a lot of easing in animations. Check it out here: jQuery Preloader

  13. Sojaner

    Hi Dimas,

    Thank you so much for this nice plugin.

    I have written a similar code and I was using my own code, but it has some problem with ie, so I decided to use yours.

    BUT, I have tested your plugin with Ietester in ie6 tab ie7 tab and ie8 and also, Safari, Chrome, Opera and Firefox also Windows’s native ie8…

    It works great in all of the browsers except ie6 and ie7!

    So I replaced your event listener code, with jQuery bind method this way:

    var img = new Image();
    $(img).bind("load", null, function() { ...
    

    And now it works great in all browsers I mentioned!

    That would be great if you update you code. :)

    Thank you so much again, :)

  14. Valerio

    Hello,
    I was looking for a plugin to preload images, and after trying a lot of things i found yours to be the best one.

    It would be nice to be able to call a function if the image does not exist or if it doesn’t load after a certain amount of time (sadly, i haven’t found anything that does that)

  15. Greg

    hello, do you think it is possible to have the image preloader plugin have ‘spinner.gif’ at each image location? so that the end user client browser knows that the image is forthcoming?
    it would be a nice feature to let the user know that it’s a larger image, and it is loading/that there is nothing wrong.
    thanks you for sharing your script! :)

  16. Rodrigo Tejero

    Hi man, thanks for this extraordinary plugin.
    Im having a problem, i’m preloading 355 images for a report, but the preloader always stop in imagen 140-240, y can get every image preloaded.

    My images are un an array y get from my database.
    Do you have any idea why this is happening?

    Thanks

  17. Rodrigo Tejero

    @Dimas, Thanks for the fast response man. In firefox, the script shut down the browser, in IE, the script stops. My images are in average, 250k.

  18. Andrew Martin

    Dude, YES! Thank you so much for finally posting an image preloader that works. You have no idea how many HACK plugins there are out there.

    THANKS!

  19. Donny

    Is there a working demo of this plugin in action?

Leave a Reply