K
Keith Hughitt
Hi all,
I am having trouble preloading images in a javascript application, and
was wondering if anyone had any suggestions.
Basically I have a bunch of images stored in a database as BLOBs. At
any given point in time a subset of those images is displayed on-
screen. At certains times I want to swap out those on screen with new
ones from the database, and do some as seamlessly as possible.
So what I've tried to do is first create Image objects for each of the
new images to load. I then reference all of the old image's dom-nodes,
append the new images to the document, and finally remove the old dom-
nodes.
It isn't working so well though. After doing some looking around in
Firebug, it seems that by the time I'm ready to remove the old images,
only some of the new images have been preloaded (the rest are still
being retrieved according to firebug). I'm wondering if this has to do
with the fact that I'm making a number of server-side calls, and the
lag-time it takes to do so is what is causing only some of the images
to be displayed.
Any ideas?
Any help would be greatly appreciated.
Thanks!
Keith
I am having trouble preloading images in a javascript application, and
was wondering if anyone had any suggestions.
Basically I have a bunch of images stored in a database as BLOBs. At
any given point in time a subset of those images is displayed on-
screen. At certains times I want to swap out those on screen with new
ones from the database, and do some as seamlessly as possible.
So what I've tried to do is first create Image objects for each of the
new images to load. I then reference all of the old image's dom-nodes,
append the new images to the document, and finally remove the old dom-
nodes.
It isn't working so well though. After doing some looking around in
Firebug, it seems that by the time I'm ready to remove the old images,
only some of the new images have been preloaded (the rest are still
being retrieved according to firebug). I'm wondering if this has to do
with the fact that I'm making a number of server-side calls, and the
lag-time it takes to do so is what is causing only some of the images
to be displayed.
Any ideas?
Any help would be greatly appreciated.
Thanks!
Keith