- 事件
-
- start
- 当排序动作开始时触发此事件。
- 定义:$('.selector').sortable({ start: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortstart', function(event, ui) { ... });
-
- sort
- 当元素发生排序时触发此事件。
- 定义:$('.selector').sortable({ sort: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sort', function(event, ui) { ... });
-
- change
- 当元素发生排序且坐标已发生改变时触发此事件。
- 定义:$('.selector').sortable({ change: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortchange', function(event, ui) { ... });
-
- beforeStop
- 当排序动作结束之前触发此事件。此时占位符元素和辅助元素仍有效。
- 定义:$('.selector').sortable({ beforeStop: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortbeforeStop', function(event, ui) { ... });
-
- stop
- 当排序动作结束时触发此事件。
- 定义:$('.selector').sortable({ stop: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortstop', function(event, ui) { ... });
-
- update
- 当排序动作结束时且元素坐标已经发生改变时触发此事件。
- 定义:$('.selector').sortable({ update: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortupdate', function(event, ui) { ... });
-
- receive
- 当一个已连接的sortable对象接收到另一个sortable对象的元素后触发此事件。
- 定义:$('.selector').sortable({ receive: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortreceive', function(event, ui) { ... });
-
- over
- 当一个元素拖拽移入另一个sortable对象后触发此事件。
- 定义:$('.selector').sortable({ over: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortover', function(event, ui) { ... });
- out
- 当一个元素拖拽移出sortable对象移出并进入另一个sortable对象后触发此事件。
- 定义:$('.selector').sortable({ out: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortout', function(event, ui) { ... });
-
- activate
- 当一个有使用连接的sortable对象开始排序动作时,所有允许的sortable触发此事件。
- 定义:$('.selector').sortable({ activate: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortactivate', function(event, ui) { ... });
-
- deactivate
- 当一个有使用连接的sortable对象结束排序动作时,所有允许的sortable触发此事件。
- 定义:$('.selector').sortable({ deactivate: function(event, ui) { ... } });
- 绑定:$('.selector').bind('sortdeactivate', function(event, ui) { ... });
-
-
- ·方法
- destory
- 从元素中移除拖拽功能。
- 用法:.sortable( 'destroy' )
-
- disable
- 禁用元素的拖拽功能。
- 用法:.sortable( 'disable' )
-
- enable
- 启用元素的拖拽功能。
- 用法:.sortable( 'enable' )
-
- option
- 获取或设置元素的参数。
- 用法:.sortable( 'option' , optionName , [value] )
-
- serialize
- 获取或设置序列化后的每个item元素的id属性。
- 用法:.sortable( 'serialize' , [options] )
-
- toArray
- 获取序列化后的每个item元素的id属性的数组。
- 用法:.sortable( 'toArray' )
-
- refresh
- 手动重新刷新当前sortable对象的item元素的排序。
- 用法:.sortable( 'refresh' )
-
- refreshPositions
- 手动重新刷新当前sortable对象的item元素的坐标,此方法可能会降低性能。
- 用法:.sortable( 'refreshPositions' )
-
- cancel
- 取消当前sortable对象中item元素的排序改变。
- 用法:.sortable( 'cancel' )
|