diff --git a/08sortable.js filter 过滤或忽略指定元素.html b/08sortable.js filter 过滤或忽略指定元素.html new file mode 100644 index 0000000..a26063b --- /dev/null +++ b/08sortable.js filter 过滤或忽略指定元素.html @@ -0,0 +1,72 @@ + + + + + + sortable.js filter属性例子 + + + + + + +
+
+
item 2 无法被拖动 class包含了filter类
+
+ item 1 +
+
+ item 2 +
+
+ item 3 +
+
+
+
+ + + + \ No newline at end of file diff --git a/temp.js b/temp.js index 76e859b..56a7881 100644 --- a/temp.js +++ b/temp.js @@ -1,16 +1,15 @@ +var g1 = document.getElementById('g1'); var ops1 = { animation: 1000, + delay: 30, draggable: '.item', - handle: '.move', + filter: '.filter', //拖动结束 onEnd: function (evt) { console.log(evt); //获取拖动后的排序 - var arr = sortable.toArray(); + var arr = sortable1.toArray(); document.getElementById('msg').innerHTML = 'A组排序结果:' + JSON.stringify(arr); }, }; -function del() { - console.log('执行了del事件'); -} -var sortable = Sortable.create(g1, ops1); +var sortable1 = Sortable.create(g1, ops1);