# Sortable
Sortable is a minimalist JavaScript library for reorderable drag-and-drop lists.
Demo: http://rubaxa.github.io/Sortable/
## Features
* Supports touch devices and [modern](http://caniuse.com/#search=drag) browsers (including IE9)
* Can drag from one list to another or within the same list
* CSS animation when moving items
* Supports drag handles *and selectable text* (better than voidberg's html5sortable)
* Smart auto-scrolling
* Built using native HTML5 drag and drop API
* Supports
* [Meteor](https://github.com/SortableJS/meteor-sortablejs)
* AngularJS
* [2.0+](https://github.com/SortableJS/angular-sortablejs)
* [1.*](https://github.com/SortableJS/angular-legacy-sortablejs)
* React
* [ES2015+](https://github.com/SortableJS/react-sortablejs)
* [Mixin](https://github.com/SortableJS/react-mixin-sortablejs)
* [Knockout](https://github.com/SortableJS/knockout-sortablejs)
* [Polymer](https://github.com/SortableJS/polymer-sortablejs)
* [Vue](https://github.com/SortableJS/Vue.Draggable)
* Supports any CSS library, e.g. [Bootstrap](#bs)
* Simple API
* [CDN](#cdn)
* No jQuery (but there is [support](#jq))
<br/>
### Articles
* [Sortable v1.0 — New capabilities](https://github.com/RubaXa/Sortable/wiki/Sortable-v1.0-—-New-capabilities/) (December 22, 2014)
* [Sorting with the help of HTML5 Drag'n'Drop API](https://github.com/RubaXa/Sortable/wiki/Sorting-with-the-help-of-HTML5-Drag'n'Drop-API/) (December 23, 2013)
<br/>
### Install
Via npm
```bash
$ npm install sortablejs --save
```
Via bower:
```bash
$ bower install --save sortablejs
```
<br/>
### Usage
```html
<ul id="items">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
```
```js
var el = document.getElementById('items');
var sortable = Sortable.create(el);
```
You can use any element for the list and its elements, not just `ul`/`li`. Here is an [example with `div`s](http://jsbin.com/qumuwe/edit?html,js,output).
---
### Options
```js
var sortable = new Sortable(el, {
group: "name", // or { name: "...", pull: [true, false, clone], put: [true, false, array] }
sort: true, // sorting inside list
delay: 0, // time in milliseconds to define when the sorting should start
disabled: false, // Disables the sortable if set to true.
store: null, // @see Store
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
handle: ".my-handle", // Drag handle selector within list items
filter: ".ignore-elements", // Selectors that do not lead to dragging (String or Function)
preventOnFilter: true, // Call `event.preventDefault()` when triggered `filter`
draggable: ".item", // Specifies which items inside the element should be draggable
ghostClass: "sortable-ghost", // Class name for the drop placeholder
chosenClass: "sortable-chosen", // Class name for the chosen item
dragClass: "sortable-drag", // Class name for the dragging item
dataIdAttr: 'data-id',
forceFallback: false, // ignore the HTML5 DnD behaviour and force the fallback to kick in
fallbackClass: "sortable-fallback", // Class name for the cloned DOM Element when using forceFallback
fallbackOnBody: false, // Appends the cloned DOM Element into the Document's Body
fallbackTolerance: 0, // Specify in pixels how far the mouse should move before it's considered as a drag.
scroll: true, // or HTMLElement
scrollFn: function(offsetX, offsetY, originalEvent) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling
scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling.
scrollSpeed: 10, // px
setData: function (/** DataTransfer */dataTransfer, /** HTMLElement*/dragEl) {
dataTransfer.setData('Text', dragEl.textContent); // `dataTransfer` object of HTML5 DragEvent
},
// Element is chosen
onChoose: function (/**Event*/evt) {
evt.oldIndex; // element index within parent
},
// Element dragging started
onStart: function (/**Event*/evt) {
evt.oldIndex; // element index within parent
},
// Element dragging ended
onEnd: function (/**Event*/evt) {
evt.oldIndex; // element's old index within parent
evt.newIndex; // element's new index within parent
},
// Element is dropped into the list from another list
onAdd: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
evt.from; // previous list
// + indexes from onEnd
},
// Changed sorting within list
onUpdate: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
// + indexes from onEnd
},
// Called by any change to the list (add / update / remove)
onSort: function (/**Event*/evt) {
// same properties as onUpdate
},
// Element is removed from the list into another list
onRemove: function (/**Event*/evt) {
// same properties as onUpdate
},
// Attempt to drag a filtered element
onFilter: function (/**Event*/evt) {
var itemEl = evt.item; // HTMLElement receiving the `mousedown|tapstart` event.
},
// Event when you move an item in the list or between lists
onMove: function (/**Event*/evt, /**Event*/originalEvent) {
// Example: http://jsbin.com/tuyafe/1/edit?js,output
evt.dragged; // dragged HTMLElement
evt.draggedRect; // TextRectangle {left, top, right и bottom}
evt.related; // HTMLElement on which have guided
evt.relatedRect; // TextRectangle
originalEvent.clientY; // mouse position
// return false; — for cancel
},
// Called when creating a clone of element
onClone: function (/**Event*/evt) {
var origEl = evt.item;
var cloneEl = evt.clone;
}
});
```
---
#### `group` option
To drag elements from one list into another, both lists must have the same `group` value.
You can also define whether lists can give away, give and keep a copy (`clone`), and receive elements.
* name: `String` — group name
* pull: `true|false|'clone'|function` — ability to move from the list. `clone` — copy the item, rather than move.
* put: `true|false|["foo", "bar"]|function` — whether elements can be added from other lists, or an array of group names from which elements can be taken.
* revertClone: `boolean` — revert cloned element to initial position after moving to a another list.
Demo:
- http://jsbin.com/naduvo/edit?js,output
- http://jsbin.com/rusuvot/edit?js,output — use of complex logic in the `pull` and` put`
- http://jsbin.com/magogub/edit?js,output — use `revertClone: true`
---
#### `sort` option
Sorting inside list.
Demo: http://jsbin.com/videzob/edit?html,js,output
---
#### `delay` option
Time in milliseconds to define when the sorting should start.
Demo: http://jsbin.com/xizeh/edit?html,js,output
---
#### `disabled` options
Disables the sortable if set to `true`.
Demo: http://jsbin.com/xiloqu/edit?html,js,output
```js
var sortable = Sortable.create(list);
document.getElementById("switcher").onclick = function () {
var state = sortable.option("disabled"); // get
sortable.option("disabled", !state); // set
};
```
---
#### `handle` option
To make list items draggable, Sortable disables text selection by the user.
That's not always desirable. To allow text selection, define a drag handler,
which is an area of every list element that allows it to be dragged around.
Demo: http://jsbin.com/newize/edit?html,js,output
```js
Sortable.create(el, {
handle: ".my-handle"
});
```
```html
<ul>
<li><span class="my-handle">::</span> list item text one
<li><span class="my-handle">::</span> list item text two
</ul>
```
```css
.my-handle {
cursor: move;
cursor: -webkit-grabbing;
}
```
---
#### `filter` option
```js
Sortable.create(list, {
filter: ".js-remove, .js-edit",
onFilter: function (e
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v1.0.46.zip
共499个文件
php:343个
mo:39个
po:26个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 198 浏览量
2022-04-22
14:44:13
上传
评论
收藏 5.03MB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v1.0.46 WP Sheet Editor - EDD Downloads Pro WP表编辑器 - EDD下载Pro" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v1.0.46.zip (499个子文件)
doxygen.config 98KB
libraries.css 118KB
libraries.min.css 89KB
styles.css 54KB
styles.min.css 42KB
dialog-boxes.css 13KB
add-ons.css 12KB
connect.css 10KB
common.css 5KB
account.css 5KB
customdoxygen.css 4KB
customizer.css 3KB
affiliation.css 2KB
styles.css 1KB
styles.css 1KB
styles.css 711B
debug.css 657B
plugins.css 514B
gdpr-optin-notice.css 323B
checkout.css 83B
.DS_Store 6KB
fontawesome-webfont.eot 162KB
drag-down-autofill-demo.gif 105KB
header.html 2KB
footer.html 652B
math-parser.jpg 14KB
libraries.js 2.58MB
libraries.min.js 987KB
scripts.js 134KB
scripts.min.js 67KB
Sortable.js 37KB
init.js 24KB
jquery.repeater.js 23KB
init.js 21KB
Sortable.min.js 18KB
jquery.repeater.min.js 11KB
init.js 10KB
init.js 6KB
doxy-boot.js 5KB
init.js 5KB
nojquery.ba-postmessage.js 5KB
postmessage.js 4KB
init.js 4KB
init.js 2KB
init.js 1KB
nojquery.ba-postmessage.min.js 1KB
init.js 1014B
init.js 567B
extensions.json 27KB
installed.json 2KB
installed.json 2KB
package.json 1KB
LICENSE 7KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
README.md 17KB
README.md 8KB
README.md 8KB
README.md 3KB
main.md 3KB
vg_sheet_editor-es_EC.mo 176KB
vg_sheet_editor-es_VE.mo 176KB
vg_sheet_editor-es_PR.mo 176KB
vg_sheet_editor-es_MX.mo 176KB
vg_sheet_editor-es_CO.mo 176KB
vg_sheet_editor-es_PE.mo 176KB
vg_sheet_editor-es_AR.mo 176KB
vg_sheet_editor-es_CR.mo 176KB
vg_sheet_editor-es_GT.mo 176KB
vg_sheet_editor-es_UY.mo 176KB
vg_sheet_editor-es_ES.mo 176KB
vg_sheet_editor-de_DE_formal.mo 173KB
vg_sheet_editor-de_DE.mo 172KB
freemius-ta.mo 91KB
freemius-ru_RU.mo 74KB
freemius-ja.mo 66KB
freemius-fr_FR.mo 62KB
freemius-es_ES.mo 61KB
freemius-he_IL.mo 61KB
freemius-it_IT.mo 60KB
freemius-nl_NL.mo 60KB
freemius-cs_CZ.mo 60KB
freemius-hu_HU.mo 59KB
freemius-da_DK.mo 58KB
freemius-en.mo 58KB
freemius-zh_CN.mo 55KB
vg_sheet_editor_edd_downloads-de_DE_formal.mo 4KB
vg_sheet_editor_edd_downloads-de_DE.mo 4KB
vg_sheet_editor_edd_downloads-es_EC.mo 3KB
vg_sheet_editor_edd_downloads-es_PE.mo 3KB
vg_sheet_editor_edd_downloads-es_GT.mo 3KB
vg_sheet_editor_edd_downloads-es_AR.mo 3KB
vg_sheet_editor_edd_downloads-es_VE.mo 3KB
vg_sheet_editor_edd_downloads-es_CO.mo 3KB
vg_sheet_editor_edd_downloads-es_MX.mo 3KB
vg_sheet_editor_edd_downloads-es_PR.mo 3KB
vg_sheet_editor_edd_downloads-es_CR.mo 3KB
vg_sheet_editor_edd_downloads-es_UY.mo 3KB
vg_sheet_editor_edd_downloads-es_ES.mo 3KB
共 499 条
- 1
- 2
- 3
- 4
- 5
资源评论
Lee达森
- 粉丝: 1563
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 神经网络 使用手写字数据集 实现分割任务 CNN
- 基于maxwell的4极6槽 内转子 11000rpm 输出转矩 156mNm 效率85% 180W 外径 48mm 内径27 轴向长度30mm 直流母线36V 永磁同步电机(永磁直流无刷)模型
- FPGA开发:SDRAM驱动代码,使用串口向sdram写数据,数据环回后被SDRAM送回到串口进行输出,中间使用FIFO进行跨时钟域处理,所用开发板DE2-115,SDRAM型号IS42S16320D
- ZTE C600&C620&C650命令参考
- python-workspace.zip.006
- FX5U FX40SSC 程序 FX5U FX 40SSC运动控制模块程序块 自己整合的针对FX 40SSC模块的功能块,支持点动故障码 状态码 相对定位 绝对定位 直接1指定轴号就可以
- 汽车二、三自由度模型 汽车二、三自由度模型 本人用了三种不同方法搭的汽车线性二自由度simulink模型,文档里包含有具体的车辆数值 适合初学者学习simulink使用(ps.模型输入为前轮转角,输出
- KUKA机器人码垛程序备份
- dbstudio-3.8.5.102.win64 神通数据库连接工具
- 开源TVBox影视盒子 小苹果影视盒子V1.5.7 2025新版
- 基于国产M0核MCU平台,全开源双电阻采样FOC高压 风机量产程序,包含龙博格电机观测器,SVPWM,顺逆风启动,五段式与七段式调制等源码,完全可以移植到别的MCU平台 适合电机算法研究
- 交替迭代法 matlab 无功优化 通过含固态变压器的无功优化算法,形成交替迭代潮流计算,最终计算出符合预期的电压曲线,程序方法包括包括牛拉法 前推回代等,参考性强
- 综合能源耦合微网优化程序matlab 程序基于冷热电联供综合能源耦合模型,采用cchp,并且含有压缩空气储能,采用粒子群优化求解
- DataGrip 2021.3 数据库连接工具
- 考虑碳交易的微网优化模型matlab
- FreeRTOS 是一款开源的、可抢占式的实时操作系统.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功