View Full Version : re-work images in array?
makaveli.2003
02-08-2003, 03:12 AM
I have this script, and at the moment as the user scrolls thru the select menu images change depending on the option selected, when I uploaded the script I discovered the pictures took soooooo long (because the images were being called individually each time) to load it decieved the object of the script, some1 told me that it is possible to store the images in the array, could some1 show me how I can re-work this script so that the images are held in the array, im desperate 4 help, can some1 plzzzzzzz help????
:confused: :confused:
Graeme Hackston
02-08-2003, 03:38 AM
Your in luck because the images are already in an array. You reffer to them using document.images eg.
alert(document.images.length)
makaveli.2003
02-08-2003, 12:49 PM
Originally posted by Graeme Hackston
Your in luck because the images are already in an array. You reffer to them using document.images eg.
alert(document.images.length)
Are they already stored in the array? What and where do I add into the code? Could u plz help.
Graeme Hackston
02-08-2003, 05:32 PM
I just looked at your page now. It has a large array of images, look for this:
var imglist = new Array();
Storing the images in an array doesn't make them load any faster. At some point, regardless of what you do, the client's browser has to download the images.
As far as I can see you have 3 options.
1/ preload the images on another page before this one. You can do this by copying the image array into script tags in a preceding page. Doing this will slow that page down instead of this one (6 of one, half dozen of the other)
2/ reduce the amount of images
3/ reduce the file size of the images in an image editing program
makaveli.2003
02-12-2003, 12:21 AM
Thanx 4 ur help, I reduced the size of the images, it works fine now, thanx again! :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.