HTML:
<div id = 'container'>
<div class = 'draggable' style="margin: auto; left: 0; right: 0; top: 50%; bottom: 50%; background: red;"></div>
JS:
$('.draggable').draggable();
看http://jsfiddle.net/EZweB/236/
移动无法正常工作,不知道如何处理
答案 0 :(得分:0)
容易做到:删除
position:absolute;
检查:http://jsfiddle.net/ryc461h1/ 干杯!
更改javascript:
$('.draggable').draggable({
start: function( event, ui ) {
$(this).css('position','relative');
},
drag: function( event, ui ) {
$(this).removeAttr("style");
}
});