扫码关注官方订阅号
想实现:把p1拖放到p2上时,p2变成半透明,鼠标放开把p2替换为p1。我使用了html5的drag,能实现拖动,但是始终没有比较好的方法实现想实现的功能,各路英雄帮帮忙呀~
小伙看你根骨奇佳,潜力无限,来学PHP伐。
我用了个拖拽库实现.. dragula
我是这样实现的:
dragula([document.querySelector('list')], { direction: 'vertical' }) .on('drag', (el) => { this.dragIndex = $(el).index() }) .on('drop', (el) => { this.dropIndex = $(el).index() // sort 内实现数据交换 this.sort() })
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
我用了个拖拽库实现.. dragula
我是这样实现的: