How can I delay loading images which are 'hidden' until DIV is scrolled

Discussion in 'Javascript' started by Gary Hasler, Jun 7, 2007.

  1. Gary Hasler

    Gary Hasler Guest

    I did an image gallery which displays groups of picture thumbnails in a
    series of horizontally scrollable DIVs. It works great, and the boss
    absolutely loves it, but I never really realized how many hundreds of
    pictures would pile up in some of them, which causes a long page load
    time, even with a high speed connection. Example:
    http://www.thelogconnection.com/inprogress_project.php?Richardson

    Does anyone have any suggestions for this? For instance, I could delay
    loading the thumbnails which are not initially visible, then they could
    begin loading when the user starts scrolling the div to the right. It
    can work in server side PHP or client side JS or both, for instance the
    server script could write html for 'blank' images after about the sixth
    image or so in each strip, then have some kind of JS "onScroll" event
    handler change the thumbnail SRCs to the real images? This sounds a bit
    complicated...better ideas?
    Gary Hasler, Jun 7, 2007
    #1
    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. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    728
  2. Jon
    Replies:
    2
    Views:
    184
  3. Replies:
    4
    Views:
    122
    Matt Kruse
    Aug 17, 2006
  4. Replies:
    4
    Views:
    180
  5. Replies:
    1
    Views:
    113
    Thomas 'PointedEars' Lahn
    Nov 15, 2007
Loading...

Share This Page