zoukankan      html  css  js  c++  java
  • 好友选中

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

    .f{ 200px; height:30px; background-color:#63C; 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>

  • 相关阅读:
    判断有无网络
    Listview的OnScrollListener的滑动监听实现分页加载
    第三方 XListview 上拉加载、下拉刷新、分页加载和Gson解析
    Gson解析数据
    百度地图实现普通地图、定位、周边搜索功能
    Viewpager实现网络图片的轮播
    英语wacche腕表
    caement Archaic spelling of cement
    水泥caement单词
    英语caement水泥
  • 原文地址:https://www.cnblogs.com/sq45711478/p/5905098.html
Copyright © 2011-2022 走看看