这是我的代码:
<div id="box" style="border:1px solid red;height:100px;width:150px;position:relative;background:#eee">
<div id="head" style="background:black">drag me</div>
<div id="content" contenteditable=true style="border-bottom:1px solid red;height:70px;margin-bottom:5px;"> edit it </div>
<input id="ok" type="button" value="ok"/>
<input id="cancel" type="button" value="cancel"/>
</div>
,脚本是:
$('#box').draggable()
演示在这里:http://jsfiddle.net/VRxZe/
感谢
答案 0 :(得分:6)
$('#box').draggable({
handle: $('#head')
});