1
jQuery代碼:拖動的元素 - JQuery用戶界面
$("#order").draggable();
HTML:
<div class="row" style="width: 100%">
<div class="col-md-4" style="width: 20%; min-width: 100px;">
<div id="order" class="ui-draggable ui-draggable-handle" style="position: relative; left: 0px; top: 20px;">
<div class="panel-body">
<div>
<span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span>
<strong>Example delivery address</strong>
</div>
<div>
<span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>
Phone number: <strong>+372 00000001</strong>
</div>
<div>
<span class="glyphicon glyphicon-time" aria-hidden="true"></span>
Ordered at: <strong>2015-10-01 20:53:56.219</strong>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<h3>Operator Orders</h3>
</div>
</div>
目前,我可以將元素ID爲 「訂單」 任何地方,但我想使元素只之間拖動「col-md-4」div元素。我怎樣才能達到這個結果?有什麼建議麼?
爲什麼不[了'containment'選項](http://jqueryui.com/draggable/#constrain移動)爲你工作? – blgt