dcsimg

Assignment 50: A Possible Answer

This...

<SCRIPT LANGUAGE="JavaScript">
var num=1

img0 = new Image (55,45)
img0.src = "0.gif"

img1 = new Image (55,45)
img1.src = "1.gif"

img2 = new Image (55,45)
img2.src = "2.gif"

img3 = new Image (55,45)
img3.src = "3.gif"

img4 = new Image (55,45)
img4.src = "4.gif"

img5 = new Image (55,45)
img5.src = "5.gif"

img6 = new Image (55,45)
img6.src = "6.gif"

img7 = new Image (55,45)
img7.src = "7.gif"

img8 = new Image (55,45)
img8.src = "8.gif"

img9 = new Image (55,45)
img9.src = "9.gif"


function startshow()
{
num=num+1
if(num==10)
{num=0}
document.mypic.src=eval("img"+num+".src") }

</SCRIPT>
<IMG SRC="0.gif" NAME="mypic" BORDER=0>
<p>
<A HREF="JavaScript:startshow()">Display animation</a>

Gives you this...

Display Animation

     Pull out the setTimeOut line and you get a slideshow effect. The user clicks and up comes the next image.

 

Did You Get It?

 

Back to the Index Page