Treehouse: Grow your CSS skills. Land your dream job.

Progress bar for preloaded images?

  • # February 10, 2012 at 7:37 pm

    I have several images that are preloaded like:

    var Image1 = new Image();
    var Image2 = new Image();
    var Image3 = new Image();

    Image1.onload = function ...();
    Image2.onload = function ...();
    Image3.onload = function ...();

    Image1.src = url;
    Image2.src = url;
    Image3.src = url;

    Which is all fine and dandy and what not. But I would like to try and set up a progress bar for them while their loading and havent been able to get it to work. Any help would be appreciated.

    I tried doing a progress bar using the onload functions, but it was being weird with instantly running the function before it was actually loaded.

    # February 13, 2012 at 1:24 am


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.