drag and drop, prevent awkward highlighting?

后端 未结 2 436
别跟我提以往
别跟我提以往 2021-02-09 06:22

I\'m building a drag and drop method, using query -onmousedown leading to -onmousemove (drag) then -onmouseup (unbinds onmousemove)

the problem is, browser defaults begi

2条回答
  •  青春惊慌失措
    2021-02-09 07:03

    add css

    -webkit-touch-callout: none;/*for mobile*/
    -webkit-user-select: none;/*for chrome*/
    -khtml-user-select: none;/*for safari*/
    -moz-user-select: none;/*for Mozilla*/
    -ms-user-select: none;/*for mircosoft*/
    -o-user-select: none;/*for opera*/
    user-select: none;/*base css ,but not work in all browsers*/
    

提交回复
热议问题