zoukankan      html  css  js  c++  java
  • ..

    window.onload = function() {
        var oDiv = document.getElementById("tab");
        var oLi = oDiv.getElementsByTagName("div")[0].getElementsByTagName("li");
        var aCon = oDiv.getElementsByTagName("div")[1].getElementsByTagName("div");
        var timer = null;
        for (var i = 0; i < oLi.length; i++) {
            oLi[i].index = i;
            oLi[i].onclick = function() {
                show(this.index);
            }
        }
        function show(a) {
            index = a;
            var alpha = 0;
            for (var j = 0; j < oLi.length; j++) {
                oLi[j].className = "";
                aCon[j].className = "";
                aCon[j].style.opacity = 0;
                aCon[j].style.filter = "alpha(opacity=0)";
            }
            oLi[index].className = "cur";
            clearInterval(timer);
            timer = setInterval(function() {
                alpha += 2;
                alpha > 100 && (alpha = 100);
                aCon[index].style.opacity = alpha / 100;
                aCon[index].style.filter = "alpha(opacity=" + alpha + ")";
                alpha == 100 && clearInterval(timer);
            },
            5)
        }
    }

  • 相关阅读:
    Noip2012 开车旅行
    「NOI2018」归程
    2019.10.30 队测(晚上)
    洛谷P1138 第k小整数
    洛谷P2870 [USACO07DEC]最佳牛线,黄金Best Cow Line, Gold
    Noip-pj2018游记
    洛谷P4994 终于结束的起点
    《退役的你》
    《膜你抄》
    洛谷P5087 数学
  • 原文地址:https://www.cnblogs.com/bingg/p/5317772.html
Copyright © 2011-2022 走看看