I\'ve got a simple jQuery sortable based on a list as follows:
- Item 1
- Item 2
- Item 3
The following worked for me:
stop: function(event,ui){
ui.item.height("auto");
}
You could grab the current height of the Div being dragged, save it in a variable and assign a generic height to the DIV being dragged. Once it's placed, use the call back to reassign the height within the variable.
var curHeight = $(div).height();
$(div).css({height: 20px;});
You may also want to consider forceHelperSize
After much hair-tearing I added this event to the sortable:
start: function( event, ui ) {
$( this ).sortable( 'refreshPositions' )
},
It seems to do the trick as I think start() is called after the helper has been created, so refreshing the positions resets the height. Probably jQuery should do this itself, but for now I'm happy.