Although I accepted the answer above, I would like to provide a solution that I came across in a period of time, since, in my opinion, this can be useful when debugging other jQuery + Twitter Bootstrap collisions. Instead of applying margin-left to all .ui-sortable-placeholder, I applied them during the start event and removed them during the sortable stop event. I also used appendTo to indicate that a helper should be added to the body of the document, and not inside the row-fluid .
CSS
.real-first-child { margin-left:0 !important; }
Javascript
$(".row-fluid").sortable({ placeholder: 'span4', helper: 'clone', appendTo: 'body', forcePlaceholderSize: true, start: function(event, ui) { $('.row-fluid > div.span4:visible:first').addClass('real-first-child'); }, stop: function(event, ui) { $('.row-fluid > div.real-first-child').removeClass('real-first-child'); }, change: function(event, ui) { $('.row-fluid > div.real-first-child').removeClass('real-first-child'); $('.row-fluid > div.span4:visible:first').addClass('real-first-child'); } });
Link: http://jsfiddle.net/dhilowitz/s7Kch/
Davidh
source share