zoukankan      html  css  js  c++  java
  • Js图片轮换

    <script type="text/javascript">
                var NowFrame = 1; //初始化显示第几张
                var MaxFrame = 3; //最大显示几张
                function show() {
                    for (var i = 1; i < (MaxFrame + 1); i++) {
                        if (i == NowFrame)
                            document.getElementById('div' + NowFrame).style.display = ''; //当前图片显示
                        else
                            document.getElementById('div' + i).style.display = 'none'; //其他的图片隐藏
                    }
                    {
                        if (NowFrame == MaxFrame) //定义下一张显示的图片
                            NowFrame = 1;
                        else
                            NowFrame++;
                    }
                    theTimer = setTimeout('show()', 1000); //设置定时器,显示下一张显示的图片
                }
            </script>

    <body  onload="show();">
        <form id="form1" runat="server">   
       <div id="tupianlunhuan">
       <img alt="" src="../images/5.png" style="display: none;" id="div1" border="0"/>   
       <img alt="" src="../images/1.jpg" style="display: none;" id="div2" border="0"/>
       <img alt="" src="../images/3.png" style="display: none;" id="div3" border="0"/>
      </div>  
        </form>
    </body>

  • 相关阅读:
    Linux 搭建SVN server
    GREENPLUM简单介绍
    监听手机录音
    Java NIO与IO的差别和比較
    元数据驱动思考实例分析
    jQuery推断复选框是否勾选
    BitBlt介绍
    Android灭亡论之Firefox OS操作系统出现
    CEGUI添加自定义控件
    IFrame和Ajax比較
  • 原文地址:https://www.cnblogs.com/yzc19838458/p/3083048.html
Copyright © 2011-2022 走看看