复制代码代码如下:
<! DocType html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transicional.dtd ">
<html xmlns = "http://www.w3.org/1999/xhtml">
<Evista>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> Images </title>
<script type = "text/javaScript">
var curindex = 0;
VAR TimeInterval = 1000;
var arr = new Array ();
arr [0] = "1 (1) .jpg";
arr [1] = "1 (2) .jpg";
arr [2] = "1 (3) .jpg";
arr [3] = "1 (4) .jpg";
arr [4] = "1 (5) .jpg";
arr [5] = "1 (6) .jpg";
arr [6] = "1 (7) .jpg";
arr [7] = "1 (8) .jpg";
setInterval (ChangeImg, TimeInterval);
función cambieMG () {
var obj = document.getElementById ("obj");
if (curindex == arr.length-1) {
curindex = 0;
} demás {
curindex += 1;
}
obj.src = arr [curindex];
}
</script>
<script language = "javaScript">
setInterval (prueba, 1000);
var array = new array ();
índice var = 0;
var array = new array ("1 (1) .jpg", "1 (2) .jpg", "1 (3) .jpg", "1 (4) .jpg", "1 (5) .jpg", "1 (6) .jpg", "1 (7) .jpg", "1 (8) .jpg");
función test () {
var myimg = document.getElementById ("imgs");
if (index == array.length-1)
{index = 0; } else {index ++; }
myimg.src = array [index];
}
</script>
</ablo>
<Body>
<img id = "obj" src = "1 (1) .jpg" borde = 0 />
</body>
<Body>
</body>
</html>