zoukankan      html  css  js  c++  java
  • 图片定时自动播放

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>图片定时自动播放</title>
    <script type="text/javascript">
    var banner = ["images/banner.jpg","images/banner1.jpg","images/banner2.jpg"];
    var number = 0;
    function sun() {
    setInterval(cycle,2000);
    }
    function cycle() {
    number++;
    if(number == banner.length) number = 0;
    document.getElementById("banner").src = banner[number];
    }
    </script>
    </head>

    <body onload="sun();">
    <img id="banner" src="images/banner.jpg" />
    </body>
    </html>

  • 相关阅读:
    使用Mybatis时报错Invalid bound statement (not found):
    MyBatis学习(3)
    选数字
    看程序写结果
    NP
    完全平方数
    hahaha
    haha

    凝视
  • 原文地址:https://www.cnblogs.com/douyage/p/4054523.html
Copyright © 2011-2022 走看看