Asynchronous Image PreLoader?

Discussion in 'ASP .Net' started by jj, Jan 20, 2009.

  1. jj

    jj Guest

    I have a grid of thumbnail images. When you rollover the images a larger
    image is shown.

    I want to pre-load the large images so that the rollovers are quick
    (currently the large image take a few seconds to load). Ideally I'd like the
    pre-load to happen in the background so that the page does not take too long
    to load.

    Is this possible? Anyone done this?

    Thanks
    JJ
     
    jj, Jan 20, 2009
    #1
    1. Advertising

  2. jj

    Hans Kesting Guest

    jj formulated on dinsdag :
    > I have a grid of thumbnail images. When you rollover the images a larger
    > image is shown.
    >
    > I want to pre-load the large images so that the rollovers are quick
    > (currently the large image take a few seconds to load). Ideally I'd like the
    > pre-load to happen in the background so that the page does not take too long
    > to load.
    >
    > Is this possible? Anyone done this?
    >
    > Thanks
    > JJ


    GIYF

    search for "preload image javascript"

    Hans Kesting
     
    Hans Kesting, Jan 20, 2009
    #2
    1. Advertising

  3. jj

    jj Guest

    Hi Hans,

    I have written a javascript image loader, but I can't see any examples of
    doing it asynchronously. It may be a simple change to use AJAX to call this
    javascript, but I'm not sure...
    Thanks,
    JJ


    "Hans Kesting" <> wrote in message
    news:...
    > jj formulated on dinsdag :
    >> I have a grid of thumbnail images. When you rollover the images a larger
    >> image is shown.
    >>
    >> I want to pre-load the large images so that the rollovers are quick
    >> (currently the large image take a few seconds to load). Ideally I'd like
    >> the pre-load to happen in the background so that the page does not take
    >> too long to load.
    >>
    >> Is this possible? Anyone done this?
    >>
    >> Thanks
    >> JJ

    >
    > GIYF
    >
    > search for "preload image javascript"
    >
    > Hans Kesting
    >
    >
     
    jj, Jan 20, 2009
    #3
  4. jj

    bruce barker Guest

    all image loads are async. so the standard trick of creating an img,
    then assigning the src is all you need. use
    window.setTimeout(loadImagesRoutine) to get the image loads to happen
    after the browser finishes page parse.

    one problem with this approach is browser download queuing. if you had
    20 images and queued up the downloads then the user rolled over image
    20, they will not see it until the other downloads complete.

    if you have a large number, you should do them in chunks. you can check
    the readyState to know if an image has been downloaded. do 1 or 2 at a time.


    -- bruce (sqlwork.com)

    jj wrote:
    > I have a grid of thumbnail images. When you rollover the images a larger
    > image is shown.
    >
    > I want to pre-load the large images so that the rollovers are quick
    > (currently the large image take a few seconds to load). Ideally I'd like
    > the pre-load to happen in the background so that the page does not take
    > too long to load.
    >
    > Is this possible? Anyone done this?
    >
    > Thanks
    > JJ
     
    bruce barker, Jan 20, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FluxForums

    Image Preloader

    FluxForums, Feb 22, 2004, in forum: Javascript
    Replies:
    3
    Views:
    105
    Hywel
    Feb 22, 2004
  2. David

    Stop do while loop - image preloader

    David, Aug 10, 2005, in forum: Javascript
    Replies:
    4
    Views:
    166
    David
    Aug 10, 2005
  3. Image Preloader

    , Dec 4, 2005, in forum: Javascript
    Replies:
    2
    Views:
    97
  4. Ross

    preloader not working

    Ross, Jan 5, 2006, in forum: Javascript
    Replies:
    8
    Views:
    101
    Thomas 'PointedEars' Lahn
    Jan 5, 2006
  5. bedges

    good ole image preloader...

    bedges, Mar 21, 2006, in forum: Javascript
    Replies:
    2
    Views:
    92
    bedges
    Mar 21, 2006
Loading...

Share This Page