我正在使用jQuery UI;可拖動http://jqueryui.com/demos/draggable調用是這樣的:jQuery可拖動離開克隆html後面
$(document).ready(function(){
$("#side_bar").sortable({
revert: true
});
$(".draggable").draggable({
containment: 'parent',
hascroll: true,
handle: 'div.box_header',
scrollSensitivity: 100,
scrollSpeed: 100,
axis: 'y',
connectToSortable: '#side_bar',
helper: 'clone',
opacity: 0.35
}); });
你可以看到http://www.sarsclan.co.uk(右側酒吧區)的HTML結構。
它似乎創建一個transparant克隆作爲拖動,但是當你拖動它時,把可拖動的div放在正確的位置,但留下原始div在它的位置,只是將dom與原始div的克隆相加它的新地方。
不客氣,很高興它解決了。 – 2010-06-07 13:53:57
現在已解決,謝謝你的迴應。 – Titan 2010-06-07 13:58:00