zoukankan      html  css  js  c++  java
  • JavaScript 学习中

    实现轮翻    低级技术可以参考:

    代码

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title>建立循环式的灯幻片</title>
            <script type="text/javascript">
                window.onload=iniAll;
                var mypix=new Array("img/1.jpg","img/2.jpg","img/3.jpg");
                var thispic=0;
                function iniAll(){
                    document.getElementById("pre").onclick=preprocess;
                    document.getElementById("next").onclick=nextprocess;
                }
                function preprocess(){
                    if(thispic==0){
                        thispic=mypix.length;
                    }
                    thispic --;
                    document.getElementById("mypicture").src=mypix[thispic];
                    
                }
                function nextprocess(){
                        thispic ++;
                    if(thispic==mypix.length){
                        thispic = 0 ;
                    }
                    document.getElementById("mypicture").src=mypix[thispic]
                    return false;
                }
            </script>
            <style type="text/css">
                img
            </style>
        </head>
        <body>
            <div id="centered">
                 <h1>imge slidershow</h1>
                 <img src="img/1.jpg" id="mypicture" alt="sideshow"/>
                 <h1>
                     <a href="#" id="pre">&lt;&lt; pre</a>&nbsp;&nbsp;
                     <a href="#" id="next">next&gt;&gt;</a>
                 </h1>
            </div>
        </body>
    </html>

  • 相关阅读:
    自定义TypeConverter把基础类型转换为复杂类型
    自学MVC看这里——全网最全ASP.NET MVC 教程汇总
    C#枚举器接口IEnumerator的实现
    nopCommerce架构分析系列(二)数据Cache
    NET下三种缓存机制(Winform里面的缓存使用 )
    【RequireJS--API学习笔记】
    Linux文件的所有权与权限
    ftp服务及其实现之vsftpd
    计算机传输层端口分类
    命令:tr
  • 原文地址:https://www.cnblogs.com/webph/p/5103951.html
Copyright © 2011-2022 走看看