tags:

views:

288

answers:

1

Hello.

Is there other ways to add a cloned element to an container than:

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

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

append just puts the element after the last element in #container. I want to decide where the position should be.

+1  A: 

You can use before() or after() to insert an element at a specific position.

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

$("#container #target").after(ui.draggable.clone());
Vincent Robert
Thanks :) that was one way to do it. Alos I find that you can use insertAfter + insertBefore.
Cudos