...

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



jessiewick
02-23-2005, 07: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">
<head>
<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] ;
}
//-->
</script>
<style type="text/css">
<!--
.border1 {
border: 1px solid #ED1516;
}
-->
</style>
</head>

chilipie
02-23-2005, 09: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.

rmedek
02-23-2005, 09: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...

http://wellstyled.com/css-nopreload-rollovers.html

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

Sorry, Chilipie...

http://codingforums.com/showthread.php?t=53114



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum