首页 > Web开发 > 详细

Jquery 点击鼠标经过离开背景样式变化

时间:2015-01-28 12:38:23      阅读:156      评论:0      收藏:0      [点我收藏+]

列表页点击、鼠标经过离开背景变化

技术分享
    <script type="text/javascript" src="/Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript">
        $(function () {
            $("table tr").click(function () { $(this).addClass("aliveTrClick").siblings().removeClass("aliveTrClick"); })
        .mouseover(function () { $(this).addClass("aliveTr"); }).mouseleave(function () { $(this).removeClass("aliveTr"); });
        });
    </script>    
    <style type="text/css">.aliveTr{ background:#DfE7D0;} .aliveTrClick{ background:#D0E7D0;}</style>
View Code

 

<table width="80%" border="1">
    <tr>
        <th>生日算命-招堂运</th>
        <th>称骨算命</th>
        <th>姓名测试</th>
        <th>.net域名的数量</th>
    </tr>
    <tr>
        <td>2003年</td>
        <td>1000</td>
        <td>2000</td>
        <td>3000</td>
    </tr>
    <tr>
        <td>2004年</td>
        <td>4000</td>
        <td>5000</td>
        <td>6000</td>
    </tr>
    <tr>
        <td>2005年</td>
        <td>7000</td>
        <td>8000</td>
        <td>9000</td>
    </tr>
</table>

Jquery 点击鼠标经过离开背景样式变化

原文:http://www.cnblogs.com/yonsy/p/4255250.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!