I have the following: http://jsfiddle.net/4QF4C/14/
Why does the red square hide behind the black line during the animation and then show after it's done? How can I fix this?
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!
I think this does what you're after: http://jsfiddle.net/4QF4C/32/
Basically all I did was change the following:
.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
}
This makes the .box
expand to include the .dot
, and be over the black line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With