sortableJS/temp.js

18 lines
568 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: 166,
//指定可以拖动的元素
draggable: '.item',
//拖动后的数据
dataIdAttr: 'data-no',
//************* 停靠位置样式 **********
ghostClass: 'ghost',
//获取拖动结束的数据
onEnd: function (evt) {
console.log(evt);
//获取拖动后的排序
var arr = sortable1.toArray();
document.getElementById('msg').innerHTML = 'A组排序结果' + JSON.stringify(arr);
},
};
var sortable1 = Sortable.create(g1, ops1);