我有兩列,左邊的一個是正方形,浮動,jQuery可拖動元素的網格。右側的列是一個jQuery放置目標。所以當我在目標上投下一滴可疑物品時,它會被追加到右欄並隱藏在左側,導致網格移動以填充剛纔那個空間。移動浮動div時,他們移動
有沒有一種方法可以使用jQuery而不是即時移動來製作動畫?
好吧,我添加了一些代碼。我想說的是,如果你要把綠色拖過去,那麼在左欄中的那些將移動以填充空白區域。我想知道他們自己製作的動作(在離開之後)是否可以製作動畫。對不起,如果我混亂,不知道如何解釋這一點。
謝謝
如果有人有任何想法最後一個凹凸。
<script type="text/javascript" src="jquery.min.js"></script>
<script src="jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
<style>
.leftColumn{ width: 300px; height: 500px; outline: 2px solid blue; margin: 50px; float: left;}
.rightColumn{ width: 300px; height: 500px; outline: 2px solid green; margin: 50px; float: left;}
.gridElement{ width: 70px; height: 70px; outline: 2px solid purple; margin: 10px; float: left;}
</style>
<div class="leftColumn">
<div style="background-color: red;" class="gridElement"></div>
<div style="background-color: orange;" class="gridElement"></div>
<div style="background-color: yellow;" class="gridElement"></div>
<div style="background-color: green;" class="gridElement"></div>
<div style="background-color: blue;" class="gridElement"></div>
<div style="background-color: purple;" class="gridElement"></div>
<div style="background-color: gray;" class="gridElement"></div>
<div style="background-color: fuchsia;" class="gridElement"></div>
</div>
<div class="rightColumn"></div>
<script type="text/javascript">
$(document).ready(function() {
$(".gridElement").draggable({revert: "invalid", containment: "window", helper: "clone", appendTo: "body"});
$(".rightColumn").droppable({drop: function(event, ui) {
$(".rightColumn").append(ui.draggable);
ui.draggable.hide();
$(".rightColumn .gridElement").show();
}});
});
</script>
你能告訴我們一些html嗎? – TheVillageIdiot 2010-01-18 20:13:32