灵活且有主见的排序 jQuery 插件
任何在任何容器中的项进行排序
完全支持嵌套的容器
连接列表
回调和事件 (见文档)
纯拖放列表
垂直和水平排序
jquery-sortable.js已测试以下浏览器
Firefox >= 3.5
Chrome
IE > 7
Safari >= 6
Opera
制作可排序的列表中包括的 3 个简单步骤
添加样式
body.dragging, body.dragging * {
cursor: move !important;
}
.dragged {
position: absolute;
opacity: 0.5;
z-index: 2000;
}
ol.example li.placeholder {
position: relative;
/** More li styles **/
}
ol.example li.placeholder:before {
position: absolute;
/** Define arrowhead **/
}定义你的 HTML
<ol class='example'> <li>First</li> <li>Second</li> <li>Third</li> </ol> <script src='js/jquery-sortable.js'></script>
调用初始值设定项
$(function () {
$("ol.example").sortable()
})