[removed] How can I set the cursor during a drag & drop operation on a website?

后端 未结 2 1319
忘了有多久
忘了有多久 2021-01-18 02:15

I am developing a Chrome browser extension that allows a drag & drop kind of operation everywhere on the page. However, while the user performs this operation the cursor

相关标签:
2条回答
  • 2021-01-18 02:28

    Simply override the "dragstart" message handler as well as the "selectstart"... While in the function cancel the event...

    <script type="text/ecmascript">
    window.addEventListener("dragstart", function(fEventObject){ CancelEvent(fEventObject); } );
    window.addEventListener("selectstart", function(fEventObject){ CancelEvent(fEventObject); } );
    
    function CancelEvent(fEventObject) 
    {
       if (fEventObject.preventDefault) fEventObject.preventDefault();
       if (fEventObject.cancel != null) fEventObject.cancel = true;
    }
    
    </script>
    
    0 讨论(0)
  • Could you add a css class to the body tag, that sets the cursor, then remove than class on drop?

    0 讨论(0)
提交回复
热议问题