zoukankan      html  css  js  c++  java
  • 不可点击的轮播图

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
    /*overflow:hidden的作用是隐藏溢出,超出设置的宽高后自动隐藏*/
    #tab { overflow:hidden; position:relative; float:left;}
    /*img里面的第一个元素外的元素都设置为*/
    #tab>img:not(:first-child){ display:none; }
     
    </style>
    <script>
        window.onload = function(){
         
            var images = document.getElementsByTagName('img');
            console.log(images)
            var pos = 0;
            var len = images.length;
             
            setInterval(function(){
             
                images[pos].style.display = 'none';
                pos = ++pos == len ? 0 : pos;
                images[pos].style.display = 'inline';
             
            },1000);
             
        };
    </script>
     
    </head>
     
    <body>
    <div id="tab">
        <img src="./img/1.jpg" />
        <img src="./img/2.jpg" />
        <img src="./img/3.jpg" />
    </div>
    </body>
    </html>

  • 相关阅读:
    HDU4611+数学
    HDU4612+Tarjan缩点+BFS求树的直径
    HDU4602+推导公式
    HDU4607+BFS
    HDU1353+贪心
    HDU4545+LCS
    HDU4548+素数
    HDU4539+状态压缩DP
    HDU2110+母函数
    HDU1569+最大点权集
  • 原文地址:https://www.cnblogs.com/zouyun/p/7130457.html
Copyright © 2011-2022 走看看