Try this instead, it's the preloader/rollover script I use for all my sites.
In the HEAD put (and of course put all 23 images in the list)
- Code: Select all
<script type="text/css">
CI = new Array()
aryI = String("001_Small.png,002_Small.png,003_Small.png,004_Small.png").split(",")
for (i=0;i<aryI.length;i++) {
CI[(i*2)] = new Image()
CI[(i*2)].src = "Pictures/" + aryI[i]
CI[(i*2+1)] = new Image()
hname = String(aryI[i]).replace(".","2.")
CI[(i*2+1)].src = "Pictures/" + hname
}
function menu(ind,bon) {
eval('document.images["r'+ind+'"].src = CI[' + ((ind*2)-(bon ? 1 : 2)) + '].src')
}
</script>
Then put each image/link in your page like this:
- Code: Select all
[img]Pictures/001_Small.png[/img]
Change the numbers in menu(#, and r# using 1 to 23