1
是否有其他方式来克隆元素添加到容器比:jQuery的:添加克隆到容器
$(".product").draggable({
helper: 'clone'
});
$("#container").append(ui.draggable.clone());
追加只是把该元素在#container的最后一个元素之后。我想确定职位应该在哪里。
是否有其他方式来克隆元素添加到容器比:jQuery的:添加克隆到容器
$(".product").draggable({
helper: 'clone'
});
$("#container").append(ui.draggable.clone());
追加只是把该元素在#container的最后一个元素之后。我想确定职位应该在哪里。
您可以使用before()
或after()
在特定位置插入元素。
$(".product").draggable({
helper: 'clone'
});
$("#container #target").after(ui.draggable.clone());
谢谢:)这是一种方式来做到这一点。阿洛斯我发现你可以使用insertAfter + insertBefore。 – Cudos 2009-05-25 13:36:29