Reputation: 147
Just discovered the joys of JQuery's "draggable" API, but I want to display my list using inline-block. This makes the list items jump when you drag them, does anyone know how to fix this?
The code I'm using is:
$(function() {
$( "#sortable1, #sortable2" ).sortable({
connectWith: ".connectedSortable"
}).disableSelection();
});
Upvotes: 4
Views: 1452
Reputation: 109
Another solution if you can't use float:
#sortable1 li, #sortable2 li{
display: inline-block;
vertical-align: top;
}
The vertical-align:top is important.
Upvotes: 6
Reputation: 206699
Just add : float:left;
to your li
elements
#sortable1 li, #sortable2 li {
float:left;
/*other styles...*/
}
Upvotes: 3