這是什麼一個簡化版本,我想實現切換DIV和縮小差距
我有一個顯示3個格箱
<div class="divd" id='div1' style="left:50px">>111</div>
<div class="divd" id='div2' style="left:150px">222</div>
<div class="divd" id='div3' style="left:250px">333</div>
<p></p>
<p></p>
<p><input type="button" id="tg" value="toggle"></p>
我使用jQuery來切換中間DIV頁面
$('#tg').click(function() {
$('#div2').toggle('slow', function() {
});
});
這
一切按預期工作,但我想要做的是「縮小差距」通過隱藏的div離開,所以最終的結果是DIV1和DIV3彼此相鄰的可以這樣做,任何指針或HEL p大加讚賞,感謝
.divd {
position:absolute ;
width: 50px;
height: 50px;
top: 50px ;
left: 120px ;
border: 1px solid black;
background-color:#999;
border-radius:5px;
z-index:200;
text-align:center;
}
通過'旁邊的每個other'你在同一條直線是什麼意思? – Ovilia 2013-03-11 14:18:27
你在說什麼?這一切看起來都很好http://jsfiddle.net/agpHB/ – Tomarinator 2013-03-11 14:19:09
是的,我完成的頁面中的div高度是我的頁面的高度 – Mick 2013-03-11 14:20:18