Sortable item from list one to list two move not working
I drop ITEM from Dragable which is right side to Sortable ( Sortable List 1 and Sortable List 2 ). After droping when i try to move item from
Sortable List 1 to
Sortable List 2 then it's not moving. I have scroll on parent div and sortable specific height which is according to my need.
Here is live
Fiddle and below myy code is :
HTML:
- <div class="main_container">
<p>
Item move from List 1 to List 2 is not working. List two is downside scroll
</p>
<div class="contianer">
<h3>
Sortable List 1
</h3>
<div class="sortable1 sortable">
</div>
<h3>
Sortable List 2
</h3>
<div class="sortable2 sortable">
</div>
</div>
<div class="dragable">
<li class="item">
item1
</li>
<li class="item">
item2
</li>
<li class="item">
item3
</li>
</div>
</div>
JQuery :
$(".dragable .item").draggable({ revert: "invalid", helper:'clone', appendTo: '.main_container', connectToSortable: '.contianer .sortable', drag: function(event, ui) { //cursor position adjustment $(this).draggable('instance').offset.click = { left: Math.floor(ui.helper.width() / 2), top: Math.floor(ui.helper.height() / 2) } }, }) $('.contianer .sortable').sortable({ connectWith: ".sortable", });
CSS:
- .sortable{
- background: gray;
- height: 750px;
- margin-bottom: 20px;
- }
- .dragable{
- float: left;
- }
- .main_container,body,html{
- overflow: hidden;
- height: 100%;
- }
- .main_container{
- position: absolute;
- width: 100%;
-
- }
- .contianer{
- overflow: auto;
- width: 300px;
- padding:0 5px;
- height: calc(100% - 57px);
- float: left;
- }