I currently have a preloading image javascript script:
function MM_preloadImages() { var d = document; if(d.images){ if(!d.MM_p ) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++){ if (a[i].indexOf('#')!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src= '/img' + a[i]; } } } }
The problem is that i have to manually update the array when images are added deleted etc.
Is there anyway of automating this or is there a library.
Most of the image urls are element hrefs.
Obviously I could write something server side but I want to check if there is something out there already.
Here is someone who did what you are trying to do with jQuery:
http://www.filamentgroup.com/lab/update_automatically_preload_images_from_css_with_jquery/
Edit: Actually this is not quite what you are looking for as this preloads images from CSS files – I am going to leave this here in case this is still helpful.