View Full Version : can anyone fix my image preloading code?

02-23-2005, 08:08 PM
can a moderator move this thread to the javascript board?

hey, i think my image preloading code is not working. does anyone see any errors?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Two Eyeballs - Relief Prints to Relieve Emptiness</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="two eyeballs, emily wick, artist, linocuts, prints, relief prints, linoleum, jessie wick, wickropolis, pigbug, oakland, art, jessica wick, emptiness">
<meta name="description" content="Linocuts by Emily Wick, in association with Wickropolis.">
<script language="JavaScript" type="text/JavaScript">

var preload = new array ('emsite/logos/allprintsroll.jpg', 'emsite/logos/newwork.jpg', 'emsite/logos/inforoll.jpg' , 'newindexbuttons/mesleepingroll2.jpg', 'newindexbuttons/pigbugroll2.jpg' , 'pigbugsleeping.jpg', 'newindexbuttons/twoeyeballsroll2.jpg', 'twoeyes.jpg', 'newindexbuttons/thesurrenderroll2.jpg', 'thesurrender.jpg', 'newindexbuttons/thefishermanroll.jpg', 'fisherman.jpg', 'newindexbuttons/justeyesroll.jpg', 'justeyeballs.jpg') ;
var loader = new array ('emsite/logos/allprintsroll.jpg', 'emsite/logos/newwork.jpg', 'emsite/logos/inforoll.jpg' , 'newindexbuttons/mesleepingroll2.jpg', 'newindexbuttons/pigbugroll2.jpg' , 'pigbugsleeping.jpg', 'newindexbuttons/twoeyeballsroll2.jpg', 'twoeyes.jpg', 'newindexbuttons/thesurrenderroll2.jpg', 'thesurrender.jpg', 'newindexbuttons/thefishermanroll.jpg', 'fisherman.jpg', 'newindexbuttons/justeyesroll.jpg', 'justeyeballs.jpg') ;
for(var i = 0; i < preload.length; i++) {
loader[i] = new image ('emsite/logos/allprintsroll.jpg', 'emsite/logos/newwork.jpg', 'emsite/logos/inforoll.jpg' , 'newindexbuttons/mesleepingroll2.jpg', 'newindexbuttons/pigbugroll2.jpg' , 'pigbugsleeping.jpg', 'newindexbuttons/twoeyeballsroll2.jpg', 'twoeyes.jpg', 'newindexbuttons/thesurrenderroll2.jpg', 'thesurrender.jpg', 'newindexbuttons/thefishermanroll.jpg', 'fisherman.jpg', 'newindexbuttons/justeyesroll.jpg', 'justeyeballs.jpg') ;
loader[i].src = preload[i] ;
<style type="text/css">
.border1 {
border: 1px solid #ED1516;

02-23-2005, 10:23 PM
As this is a JavaScript related question, it should be in the JS forums. Ask a mod to move it, do not double post.

02-23-2005, 10:35 PM
Go get 'em Ollie :)

Hey, as long as you're here in the CSS forums, why not try CSS rollovers? No messy code, cross-broser compatible, fast load times, less images...


Maybe it'll change your world, who knows? :D

Sorry, Chilipie...