0

I have a list of element, I want to make it sortable and draggable using Jquery. But when we dragg the particular element, it should not overlap to other existing element.Please any one help me.

user112233
  • 41
  • 5
shama
  • 11
  • 4

2 Answers2

0
<script>

 $(function() {

$( ".abc" ).draggable();

});

</script>
<ul>
<li class="abc"> 1 </li>
<li class="abc"> 2 </li>
<li class="abc"> 3 </li>
</ul>
user112233
  • 41
  • 5
0
<script>
 $(function() {
$( ".abc" ).draggable({
connectToSortable: "#sortable",
revert: "invalid"
});
$( "#sortable" ).sortable({
   revert: true
});
 $( "#sortable" ).disableSelection();
});
</script>
<ul id="sortable">
<li class="abc"> 1 </li>
<li class="abc"> 2 </li>
<li class="abc"> 3 </li>
</ul>

user112233
  • 41
  • 5