开发者

how to make '#box' draggable only by drag the '#head' div , not make the '#box' draggable when i drag '#content'

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')
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜