I tried to make a nice example for Draggable jQuery with Bootstrap , it's working fine till now , but i need the draggable swap the divs .
HTML :
<div class="container" style="height:220px;background-color:gray;">
<div id="catalog">
<div>
<div class="col-sm-3 color">Test1</div>
<div class="col-sm-3 color1">Test2</div>
<div class="col-sm-3 color">Test3</div>
</div>
</div>
</div>
<div id="bigContainer">
<div class="container" style=" margin-top:10px;">
<div class="cart col-sm-6" style="height:250px;background-color:#043F35;">
<div class="RemoveDIV">Add your items here</div>
</div>
<div class="cart col-sm-6" style="height:250px;background-color:#BC0F76;">
<div class="RemoveDIV">Add your items here</div>
</div>
</div>
</div>
JQUERY:
$(function() {
$( "#catalog div" ).draggable({
appendTo: "body",
helper: "clone"
});
$( ".cart ").droppable({
hoverClass: "ui-state-hover",
accept: ":not(.ui-sortable-helper)",
drop: function( event, ui ) {
$(this).find( ".RemoveDIV" ).remove();
$( "<div class='col-sm-4'></div>" ).text( ui.draggable.text()).appendTo(this);
}
})
.sortable({connectWith: ".cart"}).sortable({items: " > div"});
});