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>

  • 相关阅读:
    组合数
    POJ2774 Long Long Message
    后缀排序【后缀数组入门题】
    luogu P3205 [HNOI2010]合唱队 区间dp
    luogu P3119 [USACO15JAN]Grass Cownoisseur G 有向图强连通分量+分层最短路
    luogu P3469 [POI2008]BLO-Blockade 割点
    luogu P2569 [SCOI2010]股票交易 单调优化dp
    luogu P2939 [USACO09FEB]Revamping Trails G 分层最短路
    luogu P3957 跳房子 二分+斜率优化dp
    luogu P1772 [ZJOI2006]物流运输 spfa最短路+dp
  • 原文地址:https://www.cnblogs.com/webph/p/5103951.html
Copyright © 2011-2022 走看看