this is my code :
<div id="box" style="border:1px solid red;height:100px开发者_如何学JAVA;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>
and the script is :
$('#box').draggable()
the demo is here :http://jsfiddle.net/VRxZe/
thanks
$('#box').draggable({
handle: $('#head')
});
精彩评论