• 9月25作业解析---好友选中


    <style type="text/css">
    *{ margin:0px auto; padding:0px; font-family:微软雅黑; font-size:16px;}

    .f{ 200px; height:30px; color:white; text-align:center; line-height:30px; vertical-align:middle; margin-top:3px}
    .f:hover{ cursor:pointer;}

    </style>

    </head>

    <body>

    <div style="200px; height:600px; margin-top:30px">

    <div class="f" onclick="Xuan(this)" onmouseover="Bian(this)" onmouseout="Hui(this)" xz="0">张三</div>
    <div class="f" onclick="Xuan(this)" onmouseover="Bian(this)" onmouseout="Hui(this)" xz="0">李四</div>
    <div class="f" onclick="Xuan(this)" onmouseover="Bian(this)" onmouseout="Hui(this)" xz="0">王五</div>
    <div class="f" onclick="Xuan(this)" onmouseover="Bian(this)" onmouseout="Hui(this)" xz="0">赵六</div>
    <div class="f" onclick="Xuan(this)" onmouseover="Bian(this)" onmouseout="Hui(this)" xz="0">马七</div>

    </div>

    </body>
    <script type="text/javascript">

    function Xuan(a)
    {
    var attr = document.getElementsByClassName("f");

    for(var i=0;i<attr.length;i++)
    {
    attr[i].style.backgroundColor = "#63C";
    attr[i].setAttribute("xz","0");
    }
    a.setAttribute("xz","1");
    a.style.backgroundColor = "#F63";
    }

    function Bian(a)
    {
    var attr = document.getElementsByClassName("f");

    for(var i=0;i<attr.length;i++)
    {
    if(attr[i].getAttribute("xz")=="0")
    {
    attr[i].style.backgroundColor = "#63C";
    }
    }

    a.style.backgroundColor = "#F63";
    }


    function Hui(a)
    {
    var attr = document.getElementsByClassName("f");

    for(var i=0;i<attr.length;i++)
    {
    if(attr[i].getAttribute("xz")=="0")
    {
    attr[i].style.backgroundColor = "#63C";
    }
    }
    }

    </script>
    </html>

  • 相关阅读:
    [na]wac无线控制器集中转发部署的几种情况
    [na]windows2008-AD域的安装
    [na]数据链路层&网络层协议小结截图版
    [na]tcp&udp层各协议小结
    [na]交换机接口文档
    [na]二层sw数据交换
    [na]wireshark排查打印机问题
    [na]ip包格式
    [na]ping提示&各系统默认的TTL值
    【VS开发】C++异常处理操作
  • 原文地址:https://www.cnblogs.com/xiaofox0018/p/5905415.html
Copyright © 2020-2023  润新知