zoukankan      html  css  js  c++  java
  • 简单手风琴特效、轮播

    <div style="position: relative;  100%; height: 500px;overflow:hidden;">
                <div id="1" style=" 85%; height: 500px; position: absolute; float: left; transition: 0.7s;background-image:url(img/by1.jpg)" onmouseover="bian(1)"></div>
                <div id="2" style=" 85%; height: 500px; position: absolute; float: left; transition: 0.7s;background-image:url(img/by2.jpg);left:5%;" onmouseover="bian(2)"></div>
                <div id="3" style=" 85%; height: 500px; position: absolute; float: left; transition: 0.7s;background-image:url(img/by3.jpg);left:10%;" onmouseover="bian(3)"></div>
                <div id="4" style=" 85%; height: 500px; position: absolute; float: left; transition: 0.7s;background-image:url(img/by4.jpg);left:15%;" onmouseover="bian(4)"></div>
            </div>
    <script>
        function bian(n)
        {
            if (n == 1)
            {
                document.getElementById("1").style.left = "";
                document.getElementById("2").style.left = "85%";
                document.getElementById("3").style.left = "90%";
                document.getElementById("4").style.left = "95%";
            }
            if (n == 2) {
                document.getElementById("1").style.left = "";
                document.getElementById("2").style.left = "5%";
                document.getElementById("3").style.left = "90%";
                document.getElementById("4").style.left = "95%";
            }
            if (n == 3) {
                document.getElementById("1").style.left = "";
                document.getElementById("2").style.left = "5%";
                document.getElementById("3").style.left = "10%";
                document.getElementById("4").style.left = "95%";
            }
            if (n == 4) {
                document.getElementById("1").style.left = "";
                document.getElementById("2").style.left = "5%";
                document.getElementById("3").style.left = "10%";
                document.getElementById("4").style.left = "15%";
            }
    
    
        }
    
    
    </script>

    简单轮播:

    <div id="t"  style="background-image:url(img/by1.jpg);100%;height:500px;">
            
    
        </div>
    <script>
        var tp = new Array();
        tp[0] = "url(img/by1.jpg)";
        tp[1] = "url(img/by2.jpg)";
        tp[2] = "url(img/by3.jpg)";
        tp[3] = "url(img/by4.jpg)";
        var tt = document.getElementById("t");
        var xb = 0;
        function huan() {
            xb++;
            if (xb == tp.length)
            {
                xb = 0;
            }
            if (xb == 0)
            {
                tt.style.backgroundImage = tp[0];
            }
            if (xb == 1)
            { tt.style.backgroundImage = tp[1];}
            if (xb == 2)
            { tt.style.backgroundImage = tp[2]; }
            if(xb == 3)
            { tt.style.backgroundImage = tp[3]; }
    
            window.setTimeout("huan()",2000);
        }
        window.setTimeout("huan()",2000);
    </script>
  • 相关阅读:
    ubuntu安装pyton-pip问题解决
    Git error: hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused b
    git入门超详细(转载)
    openpose-opencv更改K分匹配算法实现
    年龄_性别识别
    人脸属性识别
    西门子PLC通过MODBUS控制变频器
    S7-200仿真软件使用
    lib/python3.6/site-packages/torchvision/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol:
    python_opencv修改视频分辨率
  • 原文地址:https://www.cnblogs.com/wy1992/p/6563835.html
Copyright © 2011-2022 走看看