JSFiddle - React, Tailwind, and code Playground
by linus
HTML
<link rel="stylesheet" href="http://code.jquery.com/ui/jquery-ui-git.css">
<script src="http://code.jquery.com/ui/jquery-ui-git.js"></script>
<ul id="sortable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<div class="helper"></div>
CSS
#sortable { list-style: none; padding: 0; }
#sortable li { border: 1px solid black; }
.ui-sortable-placeholder { background: #f00; visibility: visible !important;}
.ui-sortable-placeholder:before {content: 'placeholder'; }
.helper { border: 1px dashed #ccc; height: 20px; background: #0f0; }
JavaScript
$("#sortable").sortable({
helper: function(){
return $('.helper');
}
}
);
$("#sortable").data('uiSortable').cancelHelperRemoval = true;