Today in the DIV move encountered a strange problem, that is, when moving the div will occasionally select the text in the Div, but also affect the smoothness of the Div movement, can be depressed to check the data useful CSS implementation of the specific principles of JS implementation of the concrete principle of a closer look directly on the solution
below from reprinted online drip:
This is a CSS style to implement the Disable mouse selection function: unselectable for IE preparation, onselectstart for Chrome, safari preparation,-moz-user-select is the cssstyle of FF:
The code is as follows:
Html,body{-moz-user-select:none;-khtml-user-select:none; user-select:none;}
<div unselectable= "on" onselectstart= "return false;" style= "-moz-user-select:none;" >
Masking the selected style definition:-moz-user-select property (FF only).
property has three property values:
1, none: With none, the child elements of all the text can not be selected, including input box text can not be selected.
2.-moz-all: All the text of the child element can be selected, but the text in the input box cannot be selected.
3.-moz-none: All the text of the child element cannot be selected, except for the text in the input box.
How to disable the selection of text in a div when the mouse moves the div