chrome sets cursor to text while dragging, why?

前端 未结 8 1232
灰色年华
灰色年华 2020-11-28 09:10

My application has many drag and drop features. While dragging I want the cursor to change to some grab cursor. Internet Explorer and Firefox work fine for this, but Chrome

8条回答
  •  抹茶落季
    2020-11-28 09:49

    If you want to prevent the browser from selecting text within an element and showing the select cursor, you can do the following:

    element.addEventListener("mousedown", function(e) { e.preventDefault(); }, false);
    

提交回复
热议问题