我试图拖动拖动的元素,这是拖动元素的克隆,但是当我拖动元素时,它会在页面中创建另一个元素。这是我的代码..拖动元素在jQuery中的克隆
jQuery(function() {
jQuery(".component").draggable({
// use a helper-clone that is append to 'body' so is not 'contained' by a pane
helper: function() {
return jQuery(this).clone().appendTo('body').css({'zIndex':5});
},
cursor: 'move'
});
jQuery('.ui-layout-center').droppable({
activeClass: 'ui-state-hover',
accept: '.component',
drop: function(event, ui) {
jQuery(this).append(jQuery(ui.draggable).clone().draggable());
}
});
});
是否有任何缺少的命令,使每一个拖动一个新的克隆?
好的谢谢。但我做到了,我想要 – Jackson 2012-01-09 11:32:23