码迷,mamicode.com
首页 > 其他好文 > 详细

鼠标点击换样式事件方法

时间:2016-10-09 13:49:10      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

<style type="text/css">

.aa{ width:90px; height:60px;text-align:center; vertical-align:middle; line-height:60px; margin-right:10px; font-size:19px; float:left;

background-color:#06F}

</style>

 

<body>

<div style=" width:990px; height:60px; background-color:#F0F;">
<div class="aa" style="border-bottom:2px solid #F00;">点击1</div>
<div class="aa">点击2</div>
<div class="aa">点击3</div>
<div class="aa">点击4</div>
<div class="aa">点击5</div>
</div>

</body>

 

<script type="text/javascript">
  $(document).ready(function(e)
{
      $(".aa").click(function()
    {
        $(".aa").css("color","#000");
        $(".aa").css("font-weight","400");
        $(".aa").css("border-bottom-style","solid");
        $(".aa").css("border-bottom","1px");
        $(this).css("color","red");


      $(this).css("font-weight","bold");
      $(this).css("border-bottom","2px");
      $(this).css("border-bottom-style","solid");
      $(this).css("border-bottom-color","red");
    })
});

鼠标点击换样式事件方法

标签:

原文地址:http://www.cnblogs.com/cuizhenyu/p/5941460.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!