• 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>

  • 相关阅读:
    txt文件按行处理工具类(可以截取小说、分析日志等)【我】
    java正则表达式取出匹配字符串
    svn客户端更改用户名
    Spring集成MyBatis完整示例
    redis的list取出数据方式速度测试
    处理大量数据的性能优化一例【我】
    unity3d结合轮廓显示,实现完整的框选目标(附Demo代码)
    Unity3dPro 和免费版的区别
    unity3d 射线扫描 忽略图层
    Unity3D角色攻击范围判定和攻击判定
  • 原文地址:https://www.cnblogs.com/webph/p/5103951.html
Copyright © 2020-2023  润新知