jquery 点击查看更多箭头变化,文字变化,超出带滚动条。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>more_up_arrows</title>
<style type="text/css">
.w1000{width:1000px;margin:0 auto;}
.mgt10{margin-top:10px;}

.pop-view-more{
    display:inline-block;
    width:180px;
    height:26px;
    border: 1px solid #cfd1d4;
    line-height:24px;
    text-align:center;
    border-radius: 4px;
    cursor: pointer;
}
.pop-view-more span{
    margin-right:5px;
    color:#555;
    font-size:12px;
}
.pop-view-more i{
    display:inline-block;
    width: 8px;
    height: 9px;
    background: url("http://images.cnblogs.com/cnblogs_com/iflygofy/817791/o_view_arrow_down.png") no-repeat 0 0;
}
.pop-view-more.up i{
    background-position:0 -10px;
}
.more-content{
    height:500px;
    padding:10px;
    border: 1px solid #cfd1d4;
}
</style>
</head>
<body>
    <div class="w1000">
        <div class="pandect-con">
            <div class="popup-box mgt10 clearfix">
                <div class="more-option">
                    <label class="pop-view-more"><span>查看更多</span><i></i></label>
                </div>
                <div class="more-content" style="display:none;">
                    <p>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</p>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script>
    $(document).ready(function() {
        $(".pop-view-more").click(function(){    
            if($(".pop-view-more span").html() == '查看更多'){
                $(this).addClass("up");
                $(".more-content").show();
                $(".pop-view-more span").html("点击收起");
                $(".pandect-con").css({ height: "350px", overflow: "auto" });
                $(".popup-box").css({ width: "388px"});
            }else{
                $(this).removeClass("up");
                $(".more-content").hide();
                $(".pop-view-more span").html("查看更多");
                $(".pandect-con").css({ height: "auto" });
                $(".popup-box").css({ width: "405px"});
            }
        }); 
    });
    </script>    
</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

智汇优库

您的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值