I have some problems with the custom jQuery UI of the plugin with the bootstrap 3 grid. I cannot place the place in the right place, but I will show it. In addition, you can make the action more ordered, sometimes the action is not performed, perhaps by slowing down the action?
<div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h1 class="panel-title">Photos</h1> </div> <div class="panel-body"> <div class="row sortable"> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">1 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">2 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">3 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">4 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">5 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">6 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">7 </a> </div> <div class="col-md-3 thumb"> <a class="thumbnail" href="#"> <img class="img-responsive" src="http://placehold.it/400x300" alt="">8 </a> </div> </div> </div> </div> </div> </div>
Js
$( ".sortable" ).sortable({ items : 'div:not(.unsortable)', placeholder : 'sortable-placeholder' }); $( ".sortable" ).disableSelection();
CSS
.sortable-placeholder { margin-left: 0 !important; border: 1px solid #ccc; background-color: yellow; -webkit-box-shadow: 0px 0px 10px #888; -moz-box-shadow: 0px 0px 10px #888; box-shadow: 0px 0px 10px #888; }
Demo
Any suggestion to solve my problem is welcome. Thanks
source share