View Single Post
Old 10-27-2006, 10:56 AM   #2 (permalink)
StupidScript
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Although caching is up to the browser, and caching headers are typically used to allow/disallow that behavior, you may be able to 'force' caching of the images by preloading them using a client-side script ... i.e. tell the browser to fetch them before they are requested from within the page code.

The same principal applies to the ol' onmouseover Javascript image swapping trick:
Code:
1_1 = new Image(); 1_1.src = "images/1_1.png"; ..etc..
then reference the script variables while populating your page:
Code:
for (i=0;i<=imgs.length-1;i++) { curr_img=imgs[i]; curr_alt=alts[i]; document.write("<img src='"+curr_img.src+"' alt='"+curr_alt+"' />"); }
where imgs is an array of the image references to be used and alts is an array of, say, artist info corresponding to each image.

Just winging it ...

Last edited by StupidScript : 10-27-2006 at 11:10 AM.
StupidScript is offline   Reply With Quote