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>

  • 相关阅读:
    【BZOJ 1598】 牛跑步
    【SDOI 2010】 魔法猪学院
    【POJ 2449】 Remmarguts' Date
    【HDU 3085】 Nightmare Ⅱ
    【POJ 3635】 Full Tank
    【POJ 2230】 Watchcow
    USB设备驱动总结
    经典SQL语句大全
    float型数据与字节数组的转化
    linux下dmesg命令详解
  • 原文地址:https://www.cnblogs.com/chenguanai/p/6670363.html
Copyright © 2011-2022 走看看