# Sortable [![CircleCI](https://circleci.com/gh/SortableJS/Sortable.svg?style=svg)](https://circleci.com/gh/SortableJS/Sortable) [![DeepScan grade](https://deepscan.io/api/teams/3901/projects/5666/branches/43977/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=3901&pid=5666&bid=43977) [![](https://data.jsdelivr.com/v1/package/npm/sortablejs/badge)](https://www.jsdelivr.com/package/npm/sortablejs) [![npm](https://img.shields.io/npm/v/sortablejs.svg)](https://www.npmjs.com/package/sortablejs)
Sortable is a JavaScript library for reorderable drag-and-drop lists.
Demo: http://sortablejs.github.io/Sortable/
[<img width="250px" src="https://raw.githubusercontent.com/SortableJS/Sortable/HEAD/st/saucelabs.svg?sanitize=true">](https://saucelabs.com/)
## 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
* Advanced swap detection
* Smooth animations
* [Multi-drag](https://github.com/SortableJS/Sortable/tree/master/plugins/MultiDrag) support
* Support for CSS transforms
* Built using native HTML5 drag and drop API
* Supports
* [Meteor](https://github.com/SortableJS/meteor-sortablejs)
* Angular
* [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)
* [Ember](https://github.com/SortableJS/ember-sortablejs)
* Supports any CSS library, e.g. [Bootstrap](#bs)
* Simple API
* Support for [plugins](#plugins)
* [CDN](#cdn)
* No jQuery required (but there is [support](https://github.com/SortableJS/jquery-sortablejs))
<br/>
### Articles
* [Dragging Multiple Items in Sortable](https://github.com/SortableJS/Sortable/wiki/Dragging-Multiple-Items-in-Sortable) (April 26, 2019)
* [Swap Thresholds and Direction](https://github.com/SortableJS/Sortable/wiki/Swap-Thresholds-and-Direction) (December 2, 2018)
* [Sortable v1.0 — New capabilities](https://github.com/SortableJS/Sortable/wiki/Sortable-v1.0-—-New-capabilities/) (December 22, 2014)
* [Sorting with the help of HTML5 Drag'n'Drop API](https://github.com/SortableJS/Sortable/wiki/Sorting-with-the-help-of-HTML5-Drag'n'Drop-API/) (December 23, 2013)
<br/>
### Getting Started
Install with NPM:
```bash
$ npm install sortablejs --save
```
Install with Bower:
```bash
$ bower install --save sortablejs
```
Import into your project:
```js
// Default SortableJS
import Sortable from 'sortablejs';
// Core SortableJS (without default plugins)
import Sortable from 'sortablejs/modular/sortable.core.esm.js';
// Complete SortableJS (with all plugins)
import Sortable from 'sortablejs/modular/sortable.complete.esm.js';
```
Cherrypick plugins:
```js
// Cherrypick extra plugins
import Sortable, { MultiDrag, Swap } from 'sortablejs';
Sortable.mount(new MultiDrag(), new Swap());
// Cherrypick default plugins
import Sortable, { AutoScroll } from 'sortablejs/modular/sortable.core.esm.js';
Sortable.mount(new AutoScroll());
```
---
### 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](https://jsbin.com/visimub/edit?html,js,output).
---
### Options
```js
var sortable = new Sortable(el, {
group: "name", // or { name: "...", pull: [true, false, 'clone', array], put: [true, false, array] }
sort: true, // sorting inside list
delay: 0, // time in milliseconds to define when the sorting should start
delayOnTouchOnly: false, // only delay if user is using touch
touchStartThreshold: 0, // px, how many pixels the point should move before cancelling a delayed drag event
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
easing: "cubic-bezier(1, 0, 0, 1)", // Easing for animation. Defaults to null. See https://easings.net/ for examples.
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
dataIdAttr: 'data-id',
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
swapThreshold: 1, // Threshold of the swap zone
invertSwap: false, // Will always use inverted swap zone if set to true
invertedSwapThreshold: 1, // Threshold of the inverted swap zone (will be set to swapThreshold value by default)
direction: 'horizontal', // Direction of Sortable (will be detected automatically if not given)
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.
dragoverBubble: false,
removeCloneOnHide: true, // Remove the clone element when it is not showing, rather than just hiding it
emptyInsertThreshold: 5, // px, distance mouse must be from empty sortable to insert drag element into it
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 is unchosen
onUnchoose: function(/**Event*/evt) {
// same properties as onEnd
},
// Element dragging started
onStart: function (/**Event*/evt) {
evt.oldIndex; // element index within parent
},
// Element dragging ended
onEnd: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
evt.to; // target list
evt.from; // previous list
evt.oldIndex; // element's old index within old parent
evt.newIndex; // element's new index within new parent
evt.oldDraggableIndex; // element's old index within old parent, only counting draggable elements
evt.newDraggableIndex; // element's new index within new parent, only counting draggable elements
evt.clone // the clone element
evt.pullMode; // when item is in another sortable: `"clone"` if cloning, `true` if moving
},
// Element is dropped into the list from another list
onAdd: function (/**Event*/evt) {
// same properties as onEnd
},
// Changed sorting within list
onUpdate: function (/**Event*/evt) {
// same properties as onEnd
},
// Called by any change to the list (add / update / remove)
onSort: function (/**Event*/evt) {
// same properties as onEnd
},
// Element is removed from the list into another list
onRemove: function (/**Event*/evt) {
// same properties as onEnd
},
// 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
没有合适的资源?快使用搜索试试~ 我知道了~
小剧场短剧影视小程序源码 全开源 带支付等模式 付费短剧小程序源码-thinkphp源码
共2002个文件
js:1294个
html:204个
md:165个
需积分: 0 122 下载量 85 浏览量
2023-09-04
15:35:54
上传
评论 5
收藏 158.28MB RAR 举报
温馨提示
后端搭建1、导入数据库文件 dkewl.sql 2、设置运行目录 /public 3、伪静态设置 location / { index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } 4、修改数据库配置文件: 地址 /application/database.php 5、后台地址: /dkewl.php 用户名admin密码123456 6,登录后台后点击常规管理-系统配置-微信api设置你的小程序那些内容即可 至于其它东西大家就自行研究后台设置了 前端搭建: 1、接口配置文件 /common/config.js 2、需要用到HBuilder X 工具来编译
资源推荐
资源详情
资源评论
收起资源包目录
小剧场短剧影视小程序源码 全开源 带支付等模式 付费短剧小程序源码-thinkphp源码 (2002个子文件)
pimple.c 37KB
backend.min.css 378KB
frontend.min.css 307KB
bootstrap.css 143KB
bootstrap.css 141KB
fastadmin.css 132KB
main.css 124KB
bootstrap.min.css 122KB
bootstrap.min.css 119KB
bootstrap.min.css 118KB
fastadmin.min.css 114KB
index.63b34199.css 94KB
_all-skins.css 48KB
selectpage.css 40KB
font-awesome.css 37KB
style.css 34KB
style.css 34KB
style.css 31KB
style.css 31KB
font-awesome.min.css 30KB
style.min.css 29KB
font-awesome.min.css 28KB
style.min.css 27KB
bootstrap-theme.css 25KB
bootstrap-table-group-by.css 24KB
bootstrap-table-group-by.css 24KB
bootstrap-theme.min.css 23KB
pay.css 22KB
backend.css 21KB
font.css 21KB
style.css 18KB
summernote.css 17KB
layer.css 15KB
layer.css 14KB
frontend.css 11KB
common.css 9KB
bootstrap-datetimepicker.css 9KB
daterangepicker.css 8KB
bootstrap-datetimepicker.min.css 8KB
toastr.css 7KB
bootstrap-select.css 7KB
bootstrap-select.css 7KB
Jcrop.css 7KB
bootstrap-table.css 7KB
bootstrap-table.css 7KB
toastr.min.css 6KB
bootstrap-select.min.css 6KB
bootstrap-select.min.css 6KB
jquery.ui.plupload.css 6KB
layer.css 6KB
bootstrap-table.min.css 6KB
index.css 6KB
animated.css 5KB
layer.css 5KB
Jcrop.min.css 5KB
custom.css 5KB
demos.css 5KB
theme.css 5KB
skin-white-light.css 5KB
slider.css 5KB
qunit.css 5KB
skin-blue-light.css 4KB
jquery.validator.css 4KB
skin-purple-light.css 4KB
skin-yellow-light.css 4KB
skin-green-light.css 4KB
skin-white.css 4KB
skin-red-light.css 4KB
jquery.plupload.queue.css 4KB
skin-blue.css 4KB
skin-yellow.css 4KB
skin-purple.css 4KB
skin-green.css 4KB
skin-red.css 3KB
style.css 3KB
style.css 3KB
city-picker.css 3KB
city-picker.css 3KB
base.css 2KB
bootstrap-datetimepicker-standalone.css 2KB
base.css 2KB
website.css 2KB
prettify.css 2KB
demo.css 1KB
index_6e7b938.css 1KB
iconfont.css 877B
style.css 842B
bootstrap-table-reorder-rows.css 819B
bootstrap-table-reorder-rows.css 819B
prettify-1.0.css 762B
prettify.css 655B
bootstrap-table-tree-column.css 582B
bootstrap-table-tree-column.css 582B
user.css 475B
bootstrap-table-sticky-header.css 416B
bootstrap-table-sticky-header.css 416B
bootstrap-table-multiple-selection-row.css 306B
bootstrap-table-multiple-selection-row.css 306B
bootstrap-table-click-edit-row.css 287B
bootstrap-table-click-edit-row.css 287B
共 2002 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
资源评论
嗼唸
- 粉丝: 19
- 资源: 444
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用NetBeans连接SQLserver2008数据库教程中文WORD版最新版本
- XPath实例中文WORD版最新版本
- XPath语法规则中文WORD版最新版本
- XPath入门教程中文WORD版最新版本
- ORACLE数据库管理系统体系结构中文WORD版最新版本
- Sybase数据库安装以及新建数据库中文WORD版最新版本
- tomcat6.0配置oracle数据库连接池中文WORD版最新版本
- hibernate连接oracle数据库中文WORD版最新版本
- MyEclipse连接MySQL的方法中文WORD版最新版本
- MyEclipse中配置Hibernate连接Oracle中文WORD版最新版本
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功