Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

incorrect behavior 'onselectstart' in Chrome

There is draggable element which must move with a 'move' cursor. The cursor will become like at selecting when I move the element. I tried to use .onselectstart = function(e) { return false } on 'mousedown' and .onselectstart = null on 'mouseup'. It works good. But it stops working after any select on the page. I observe it in Google Chrome and Maxthon only.

So, take a look http://jsfiddle.net/JqMgE/1/

Sometimes needs select a few times to call this bug.

like image 381
Novelist Avatar asked Dec 04 '25 17:12

Novelist


1 Answers

I solved the problem by using event.preventDefault() onmousedown and onmousemove.

http://jsfiddle.net/JqMgE/2

There is no need to use .onselectstart.

like image 133
Novelist Avatar answered Dec 06 '25 07:12

Novelist