Connecting Tech Pros Worldwide Forums | Help | Site Map

Using AJAX (XmlHttpRequest) to load images

dean.h.brown@gmail.com
Guest
 
Posts: n/a
#1: Mar 23 '06
I'd like to create a slideshow using the same technology that Google
Maps uses:
Load/unload images offscreen and the user can drag the images around.

Dragging the images is easy
(http://www.walterzorn.com/dragdrop/dragdrop_e.htm)

But I haven't found a way to load the images as needed (There may be
100's so I don't want to load them all when the page loads)

Thanks!


Ian Collins
Guest
 
Posts: n/a
#2: Mar 23 '06

re: Using AJAX (XmlHttpRequest) to load images


dean.h.brown@gmail.com wrote:[color=blue]
> I'd like to create a slideshow using the same technology that Google
> Maps uses:
> Load/unload images offscreen and the user can drag the images around.
>
> Dragging the images is easy
> (http://www.walterzorn.com/dragdrop/dragdrop_e.htm)
>
> But I haven't found a way to load the images as needed (There may be
> 100's so I don't want to load them all when the page loads)
>[/color]
You don't need AJAX, just create a new img element and add it to your page.

var img = new Image( width, height );
img.src = <some URL>;

someContainer.appendChild( img );

--
Ian Collins.
ajaxtoday
Guest
 
Posts: n/a
#3: Mar 23 '06

re: Using AJAX (XmlHttpRequest) to load images


May be you can use AJAX to fetch urls for the images for each slide
from the server and assign it the src property of IMG element, browser
will read the image and show it for you.

- Rafiq.
http://www.ajaxtoday.com

Closed Thread