Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有其他方法可以将克隆元素添加到容器中,而不是:
$(".product").draggable({ helper: 'clone' }); $("#container").append(ui.draggable.clone());
append 只是将元素放在#container 中的最后一个元素之后。我想决定职位应该在哪里。
您可以使用before()或after()在特定位置插入元素。
before()
after()
$(".product").draggable({ helper: 'clone' }); $("#container #target").after(ui.draggable.clone());