Bag*_*ell 5 javascript css jquery jquery-ui
我有以下内容: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>
Run Code Online (Sandbox Code Playgroud)
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;
}
Run Code Online (Sandbox Code Playgroud)
JQuery的:
$('a').click(function() {
$(".box").hide().show("blind");
$("a").hide();
});
Run Code Online (Sandbox Code Playgroud)
请帮忙!
我认为这符合您的要求:http ://jsfiddle.net/4QF4C/32/
基本上我所做的就是更改以下内容:
.box {
left: -11px; // Added
margin: 10px 0 0 28px; // Changed the margin-left portion to add 11px
overflow: visible; // Added this; not sure if it's necessary
}
Run Code Online (Sandbox Code Playgroud)
这使得.box扩展包括.dot, 并超过黑线。
| 归档时间: |
|
| 查看次数: |
373 次 |
| 最近记录: |