sortableJS/temp.js

21 lines
650 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var g1 = document.getElementById('g1');
var ops1 = {
animation: 1000,
delay: 1000,
draggable: '.item',
//停靠位置样式
ghostClass: 'ghost',
//************* 选中样式 ***********
chosenClass: 'chosen',
//禁用html5原生拖拽行为
forceFallback: true,
group: { name: 'itxst.com', pull: true, put: true },
//拖动结束
onEnd: function (evt) {
console.log(evt);
//获取拖动后的排序
var arr = sortable1.toArray();
document.getElementById('msg').innerHTML = 'A组排序结果' + JSON.stringify(arr);
},
};
var sortable1 = Sortable.create(g1, ops1);