• ..


    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)
        }
    }

  • 相关阅读:
    输入输出缓冲流(注册登录实现)
    BufferedWriter
    vue2饿了吗之路第一篇:开发环境准备
    Vue之生命周期
    CSS之Flex布局
    Python爬虫之路第二篇:实战
    python爬虫之路第一篇:入门
    python之字典Dict
    python之元祖tuple
    python之列表list
  • 原文地址:https://www.cnblogs.com/bingg/p/5317772.html
Copyright © 2020-2023  润新知