且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

拖动时拖动,拖动和拖动即时关闭

更新时间:2023-11-13 11:59:34

有这个问题刚才 - 这是一个Chrome bug,你不能在dragStart事件中操纵DOM,否则dragEnd会立即触发。对我而言,解决方案是使用setTimeout()并在超时功能内操作DOM。

Had this problem just now - it is a Chrome bug, you must not manipulate the DOM in dragStart event, or else dragEnd fires immediately. The solution for me turned out to be - use setTimeout() and manipulate the DOM inside the function you timeout.