Can do something like this:
$(".connectedSortable").on('click','li', function () {
/* make sure only one selected at a time in a list*/
$(this).siblings().removeClass('selected')
$(this).toggleClass('selected');
switchSelectedItems()
});
function switchSelectedItems() {
var $selected = $('.selected');
/* make sure there is a pair*/
if ($selected.length == 2) {
$selected.each(function () {
$(this).after($selected.not(this).clone().removeClass('selected'));
}).remove()
}
}
What this code does is make a clone of each of the selected items, places that after it's match in other list, then removes the originals