javascript - JQuery - 拖放工作但如何禁用多选?
问题描述
我研究了一个我想用于项目的代码笔;https://jsfiddle.net/6mhndzr5/ 当我拖放单张卡片时,一切正常。
但是当我在卡片之间单击时,它会多选一列中的所有卡片。当在列之外定位这个多选时,我得到不同的错误;
jquery-2.2.4.min.js:3 Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The new child element contains the parent.
at HTMLUListElement.<anonymous> (https://code.jquery.com/jquery-2.2.4.min.js:3:14925)
at ua (https://code.jquery.com/jquery-2.2.4.min.js:3:13069)
at n.fn.init.before (https://code.jquery.com/jquery-2.2.4.min.js:3:14862)
at e.<computed>.<computed>._clear (https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js:12:18654)
at e.<computed>.<computed>._clear (https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js:6:7987)
at HTMLUListElement.<anonymous> (https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js:12:3225)
at HTMLUListElement.d.complete (https://code.jquery.com/jquery-2.2.4.min.js:3:27958)
at i (https://code.jquery.com/jquery-2.2.4.min.js:2:27151)
at Object.fireWith [as resolveWith] (https://code.jquery.com/jquery-2.2.4.min.js:2:27914)
at i (https://code.jquery.com/jquery-2.2.4.min.js:3:26240)
我只希望单选成为可能
有什么办法(可能是javascript,可能是css)来确保不可能进行多选?还是取消这个效果?
提前谢谢,Joost
解决方案
推荐阅读
- typescript - 导出类型的打字稿问题
- c# - 使用 DataContractJsonSerializer 序列化时出现 InvalidDataContractException
- c# - jQuery(...).kendoGrid 不是函数
- c++ - 使用 odb 映射原子值时出现错误
- r - 如何通过 R 中的多个子列表运行函数?
- angular - Angular:在日期比较中排除时间
- docker - 具有 sudo 权限的 docker 只能从 Internet 访问
- c++ - 在 C++ 接口声明中使用关键字
- java - 为什么授权不起作用并且无法访问页面?
- excel - VBA代码循环浏览文件夹中的文件