dcsimg

Lesson 50: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="JavaScript">

var num=0

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")

setTimeout("startshow()","1000")

}

</SCRIPT>

<IMG SRC="0.gif" NAME="mypic" BORDER=0>

<A HREF="javascript:startshow()">Display Animation</a>

 

The Script's Effect

Display Animation

 

Back to the Index Page