zoukankan      html  css  js  c++  java
  • 图片轮播(二)--2017-04-05

    显示多张的图片轮播:

    关键点:算好div,table,图片的宽度

    <style>
    *{
    margin: 0px;
    padding: 0px;
    }
    .nav{
    800px;
    height: 200px;
    position: relative;
    background-color: yellow;
    overflow: hidden;
    }
    #aa{
    position:relative;
    top:0px;
    left:0px;
    transition:1s;
    }
    #aa img:hover{
    transform: scale(1.2);
    }
    </style>
    </head>
    <body>
    <div class="nav">
    <table cellpadding="0" cellspacing="0" id="aa">
    <tr height="200">
    <td><img src="1.jpg" width="200" height="200px"/></td>
    <td><img src="2.jpg" width="200" height="200px"/></td>
    <td><img src="3.jpg" width="200" height="200px"/></td>
    <td><img src="4.jpg" width="200" height="200px" /></td>
    <td><img src="5.jpg" width="200" height="200px" /></td>
    <td><img src="6.jpg" width="200" height="200px" /></td>
    <td><img src="7.jpg" width="200" height="200px" /></td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    <script>
    document.getElementById("aa").style.left="0px";
    function shao()
    {
    var aa = parseInt(document.getElementById("aa").style.left);
    if(aa>-600)
    {
    document.getElementById("aa").style.left=(aa-200)+"px"

    }
    else
    {
    document.getElementById("aa").style.left="0px"
    }
    bb = window.setTimeout("shao()",1000);
    }
    bb = window.setTimeout("shao()",1000);
    </script>

  • 相关阅读:
    Tinyhttpd 代码学习
    Windows noinstall zip 安装MySQL。
    Java 优先队列
    Java Comparable 和 Comparator
    Centos6.6下安装Python3.5
    对象的实现
    对象接口
    适配器模式
    java基础学习(一)
    【MongoDB】如何注册windows服务
  • 原文地址:https://www.cnblogs.com/chenguanai/p/6670363.html
Copyright © 2011-2022 走看看