我有以下内容:http://jsfiddle.net/4QF4C/14/。为什么红色正方形在动画期间会隐藏在黑线后面,结束后才显示出来?我该如何修复此问题?HTML:
<div class="container">
<div class="content">
<div class="box-static">
This is a static box that isn't effected by JQuery.
<div class="dot"></div>
</div>
<div class="box">
This is just some text.
<div class="dot"></div>
</div>
<a href="#">Click Me!</a>
</div>
</div>
CSS:
.container {
width: 900px;
margin-left: auto;
margin-right: auto;
}
.content {
width: 550px;
float: right;
border-left: 5px solid black;
position: relative;
height: 250px;
}
.box-static {
width: 500px;
position: relative;
padding: 12px;
margin: 10px 0 0 17px;
background-color: lightgrey;
border: 1px solid black;
}
.dot {
display: block;
position: absolute;
width: 16px;
height: 16px;
background-color: red;
top: 50%;
left: -28px;
margin-top: -8px;
}
.dot:after {
content: "";
display: block;
position: absolute;
width: 8px;
height: 8px;
background-color: white;
top: 4px;
left: 4px;
}
.box {
width: 500px;
position: relative;
padding: 12px;
margin: 10px 0 0 17px;
background-color: lightgrey;
border: 1px solid black;
display: none;
}
JQuery:
$('a').click(function() {
$(".box").hide().show("blind");
$("a").hide();
});
Please help!
.show('blind')
方法期间,左侧在动画完成之前都在线条后面。即使将动画类型更改为.show('fade')
,盒子的中间部分也会在完成之前隐藏在线条后面。 - cssyphus