Click to See Complete Forum and Search --> : image display sequence
MarkC
04-11-2003, 07:44 PM
I need a script that will display web page images in a predictable order. 'Frinstance, if a page has six images and I want them to display in the order 3, 6, 1, 2, 5, 4. I have searched for this in other JavaScript web areas and have not been able to find it.
Mark
Um....? Let's see, how about you just use HTML: <img src="3.gif"> <img src="6.gif"> etcetera. Or is there something else you meant? Please try to explain yourself better.
MarkC
04-11-2003, 09:41 PM
Sorry - all I want to do is predetermine the sequence with which the images display on a web page. THIS image to display first, THAT image to display next, and ANOTHER image to display next, until all are displayed. HTML won't do that and I don't know enough JavaScript to figure it out myself. I assume it would require an array of pics and some kind of doc.write method??
Um... okay, put all of the images in order without src's. Then use onload="document.images[3].src='blah.jpg';" in the order you want them.
MarkC
04-12-2003, 03:22 PM
Thanks, Jona - but I am quite JavaScript challenged, could you give me the exact script syntax?
OKay....
<html><head><title>Your title</title></head>
<body onload='document.images[1].src='file2.gif';document.images[3].src='file4.gif';document.images[5].src='file6.gif';document.images[0].src='file1.gif';document.images[2].src='file3.gif'">
<img alt="img0"><br>
<img alt="img1"><br>
<img alt="img2"><br>
<img alt="img3"><br>
<img alt="img4"><br>
<img alt="img5">
</body></html>
Note that when I put a [0] it means the first image; [1] means the second image, and so on.