用jQuery一句话实现鼠标移上变色

来源:互联网 发布:新网互联域名证书查询 编辑:程序博客网 时间:2024/05/03 19:58

按钮移上变色效果

<style>

   .round-corner-btn {
            -moz-border-radius:4px;
            -webkit-border-radius: 4px;
            -khtml-border-radius: 4px;
            border-radius: 4px;


            width:200px; height:40px; line-height: 40px;
            background: green;
            display:inline-block;
            color:white;
            text-align : center;
            cursor: pointer;
        }


        .avatar_size{
            font-size:12px;
            text-align: center;
            margin-top:4px;
        }


        .btn-hover{
            opacity: 0.8;
        }

</style>


<div class='round-corner-btn'> 按钮</div>


<script>

        $('.round-corner-btn').hover(function(){
            $(this).toggleClass('btn-hover', 200);

        })

</script>

0 0
原创粉丝点击