Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How can I delay loading images which are 'hidden' until DIV is scrolled

Thread Tools

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

Gary Hasler
Posts: n/a
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:

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?
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
Div popup changes browser scrolled position Javascript 1 11-15-2007 03:38 PM
how to set table's first column to be static and remaining can be scrolled through CSS Javascript 4 08-17-2006 02:59 PM