实现拖放的JS库:dragula
dragula让你能够很方便地实现拖拽功能的JS库。
特性
- 超级易于使用
- 没有臃肿的依赖
- 计算出自身的排序顺序
- A shadow where the item would be dropped offers visual feedback
- 触摸事件!
dragula(containers, { moves: function (el, container) { return true; // elements are always draggable by default }, accepts: function (el, target, source, sibling) { return true; // elements can be dropped in any of the `containers` by default }, direction: 'vertical', // Y axis is considered when determining where an element would be dropped copy: false, // elements are moved by default, not copied revertOnSpill: false, // spilling will put the element back where it was dragged from, if this is true removeOnSpill: false // spilling will `.remove` the element, if this is true });
本文由用户 fdwm 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!