1

是否有其他方法可以将克隆元素添加到容器中,而不是:

$(".product").draggable({
    helper: 'clone'
});

$("#container").append(ui.draggable.clone());

append 只是将元素放在#container 中的最后一个元素之后。我想决定职位应该在哪里。

4

1 回答 1

2

您可以使用before()after()在特定位置插入元素。

$(".product").draggable({
    helper: 'clone'
});

$("#container #target").after(ui.draggable.clone());
于 2009-05-25T13:19:29.640 回答