<!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>