javascript - 使用jquery模拟拖放

标签 javascript jquery

我想用 jquery 或 javascript 模拟拖放。

我必须在数据表中模拟拖放操作。

 <table class="dataTable table table-hover null table-cells dragDropTable table-draggable"  id='tableListViewFields' data-testid='tableListViewFields'>    
     <thead>
         <tr>
             <th>Name</th>
         </tr>
     </thead>
     <tbody>
         <tr class="drag-cue" data-name="test" data-index="1">
             <td class="no-border-right">
                 test
             </td>
          </tr>

     </tbody>                    
</table>

目标表看起来相同。

那么如何模拟从一个行元素到另一个行元素的拖放?

最佳答案

我找到了另一个解决方案: 我现在用https://github.com/j-ulrich/jquery-simulate-ext/blob/master/doc/drag-n-drop.md它有一个非常简单的拖放实现

关于javascript - 使用jquery模拟拖放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49775777/

相关文章:

javascript - 以编程方式设置数字输入值不起作用

javascript - 如何在提交表单时加载警报插件

javascript - 在 $.post 函数中访问 $(this) ?

javascript - 如何将 ID 和字段值分配给隐藏字段

javascript - 如何让用户看到正在下载的 Azure blob 存储文件,而不是在 Angular 的网络选项卡本身中下载完整的流

javascript - Node.js 如何同时处理多个请求

jquery - jqGrid的 "loadonce:true"和 "datatype: json"相处不好

jquery - 在所有触摸设备上滚动中断 - Wordpress

javascript - 将 Enter 键映射到 HTML/CSS/JS 中的按钮

javascript - 如何使用构造函数创建对象数组?