Skip to content

Droppable(放置)

使用$.fn.iDroppable.defaults重写默认值对象。

用法

通过标签创建一个放置区。

html
<div id="dd" data-toggle="topjui-droppable" data-options="accept:'#d1,#d3'" style="width:100px;height:100px;"></div>

使用Javascript创建一个放置区。

html
<div id="dd" style="width:100px;height:100px;"></div>
javascript
$('#dd').iDroppable({
  accept:'#d1,#d3'
});

属性

属性名属性值类型描述默认值
acceptselector确定哪些可拖拽元素将被接受。null
disabledboolean如果为true,则禁止放置。false

事件

事件名事件参数描述
onDragEntere,source在被拖拽元素到放置区内的时候触发,source参数表示被拖拽的DOM元素。
onDragOvere,source在被拖拽元素经过放置区的时候触发,source参数表示被拖拽的DOM元素。
onDragLeavee,source在被拖拽元素离开放置区的时候触发,source参数表示被拖拽的DOM元素。
onDrope,source在被拖拽元素放入到放置区的时候触发,source参数表示被拖拽的DOM元素。

方法

方法名方法参数描述
optionsnone返回属性对象。
enablenone启用放置功能。
disablenone禁用放置功能。

基于最新稳定版jQuery EasyUI构建的前端框架