On Nov 7, 2:56 am, Terry <w...@rogers.comwrote:
Hi folks.
I am about to embark on creating a slideshow using javascript and css.
I was wondering what do people consider the best way to preload the
images to be used within the show.
I saw a technique where the images were stored in 1 px by 1px divs
with overflow set to hidden.
That technique is not dependent on javascript to load the images and
is appropriate for circustances where that is required. It is not
appropriate for other cases (see below).
I am sure there are other methods as well. I know in years gone by I
used to see the images stored in an array (javascript).
Any suggestions?
It depends. If the images will only be shown using script, it seems
reasonable to load them using script. If scripting is not available,
then the images won't be loaded and the user won't have wasted
bandwidth downloading them.
On the other hand, if you have a fall-back mechanism and want the
images loaded regardless of whether scripting is available or not, use
the suggested div method to ensure that they are loaded and cached by
the browser.
But don't get carried away pre-loading a swag of images that the user
may never want to view whether they have scripting available or not.
--
Rob