jQuery UI Library Sortable Stationary Items when dragging

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

This example uses a class on the placeholder to turn it into a line and make it take up no room.

HTML

<div id="sortable">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</div>

JS

$("#sortable").sortable({
    placeholder: 'placeholder',
    helper: 'clone',
    start: function(event, ui){
        ui.item.show();
    }
});

CSS

#sortable div{
  background-color: #f00;
  width: 50px;
  height: 50px;
  margin: 10px;
  padding: 0px;
}
#sortable div.placeholder{
  height: 4px;
  margin: -7px 10px;
}


Got any jQuery UI Library Question?