jQuery EasyUI API 中文文档 Draggable 可拖拽

2020-05-19 07:37:15易采站长站整理

用$.fn.draggable.defaults重写默认的defaults。
用法

<div id=”dd” style=”width:100px;height:100px;”>
<div id=”title” style=”background:#ccc;”>title</div>
</div>


$(‘#dd’).draggable({
handle:’#title’
});


特性






















































名称


类型


说明


默认值


proxy


string,function


拖拽时要使用的代理元素,设置为’clone’时,克隆元素将被用作代理。如果指定一个函数,它必须返回一个jQuery对象。


null


revert


boolean


如果设为true,拖拽结束后元素将返回它的开始位置。


false


cursor


string


拖拽时的css光标(cursor)。


move


deltaX


number


拖拽的元素相对于当前光标的位置的X。


null


deltaY


number


拖拽的元素相对于当前光标的位置的Y。


null


handle


selector


启动draggable的处理(handle)。


null


disabled


boolean


设为true就停止draggable。


false


edge


number


能够在其中开始draggable.的拖拽宽度。


0


axis


string


定义拖拽元素可在其上移动的轴,可用的值是’v’或’h’,当设为null,将会沿着’v’和’h’的方向移动。


null


事件







名称