I have two panels, one on the left and another one on the right side. There are many spans in the left panel. When user clicks on any span in the left panel, I move them to right panel using the following code:
$(".left-panel span").click(function(){
$(".right-panel").append(this);
});
Everything is OK, just If user clicks on the 5th span first, then clicks on 2nd span, I want the 2nd span to be before 5th span.
I want the spans to move with same other in the left panel.
Note: Please do not suggest to use jQuery.prepend() function. Think about other spans too.
right-paneland then reordering them based on some condition