<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript"> function init(){ setInterval("changelunbo()",1000); } var i = 1; function changelunbo(){ i++; var imgE = document.getElementById("lunbo"); imgE.src = "img/2."+i+".jpg"; if(i == 4){ i = 0; } } </script> </head> <body onload="init()"> <img src="img/2.1.jpg"/ id="lunbo"> </body> </html>
原文地址:https://www.cnblogs.com/wuleh/p/8527100.html
时间: 2024-10-30 17:10:04