复制代码代码如下:
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // pt" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-bransitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> imagens </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);
função alteração de alteração () {
var obj = document.getElementById ("obj");
if (Curindex == arr.length-1) {
Curindex = 0;
} outro {
Curindex += 1;
}
obj.src = arr [curindex];
}
</script>
<Script Language = "JavaScript">
setInterval (teste, 1000);
var array = new Array ();
var índice = 0;
var Array = nova matriz ("1 (1) .jpg", "1 (2) .jpg", "1 (3) .jpg", "1 (4) .jpg", "1 (5) .jpg", "1 (6) .jpg", "1) .jpg", "1 (8).
function test () {
var myimg = document.getElementById ("imgs");
if (index == Array.Length-1)
{index = 0; } else {index ++; }
myimg.src = array [index];
}
</script>
</head>
<Body>
<img id = "obj" src = "1 (1) .jpg" borda = 0 />
</body>
<Body>
</body>
</html>