• 不可点击的轮播图


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

  • 相关阅读:
    vue-router 动态路由匹配
    vue-router $route
    vuex mapActions
    vuex mapMutations 使用
    ES6 动态计算属性名
    vuex Payload 荷载
    vuex mapGetters
    vuex mapState使用
    Vue 引入ElementUI 2.0.11:依赖未发现的问题
    vuex 深入理解
  • 原文地址:https://www.cnblogs.com/zouyun/p/7130457.html
Copyright © 2020-2023  润新知