Action_移入改变


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        * {
            margin:0px;
            padding:0px;
        }
        body {
            background-color:#ccc;
        }
        .box {
            width:35px;
            height:35px;
            /*width:196px;
            height:200px;*/
            position:relative;
            top:200px;
            left:200px;
            padding:5px;
            overflow:hidden;
        }
        .box div {
            width:15px;
            height:15px;
            position:absolute;
        }
        .box .left {
            left:0px;
            border-left:2px solid #fff;
        }
        .box .right {
            right:0px;
            border-right:2px solid #fff;
        }
        .box .top {
            top:0px;
            border-top:2px solid #fff;
        }
            bottom:0px;
            border-bottom:2px solid #fff;
        }
        .box .centre {
            width:13px;
            height:13px;
            border:2px solid #fff;
            border-radius:90px;
            position:absolute;
            top:14px;
            left:14px;
        }
        .box .centent {
            width:196px;
            height:auto;
            display:none;
        }
        .box .centent span {
            display:block;
            width:156px;
            height:auto;
            font-size:13px;
            font-family:"微软雅黑",Arial,Times;
            margin:0px auto;
            padding:20px;
            background-color:#C1DDF6;
        }
        .box:hover {
            cursor:pointer;
        }
        .box:hover > .centent {
            display:block;
        }
        .box:hover > .centre {
            display:none;
        }
    </style>
    <script src="http://code.jquery.com/jquery-1.11.0.js" type="text/javascript" charset="utf-8" ></script>
</head>
<body>
    <div class="box">
        <div class="left top"></div>
        <div class="right top"></div>
        <div class="left bottom"></div>
        <div class="right bottom"></div>
        <div class="centre"></div>
        <div class="centent">
            <span>
                      我能怎么办,我也很绝望啊
            </span>
        </div>
    </div>
    <script type="text/javascript">
        var ch = parseInt($(".box .centent").css("height"));
        var bh = parseInt($(".box").css("height"))+10;
        
        $(".box").hover(function(){
            $(".box").css({
                "height":ch+"px",
                "width":196+"px",
                "top":(200-(ch/2-bh/2))+"px",
                "left":123+"px",
            });
        },function(){
            $(".box").css({
                "height":35+"px",
                "width":35+"px",
                "top":200+"px",
                "left":200+"px",
            });    
        });
    </script>
</body>
</html>




  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值