Javascript method to hide the mouse: First use the "document.getElementById("id value")" statement to obtain the specified element object; then use the "element object.style.cursor="none"" statement to set the mouse hiding effect That’s it.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
javascripthide mouse
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> div{ background-color: palegoldenrod; padding: 10px; } </style> </head> <body> <div id="cursor">鼠标在div元素上时,会被隐藏!</div> </body> <script type="text/javascript"> var div=document.getElementById("cursor"); div.style.cursor="none"; </script> </html>
Rendering:
##Description :
# The cursor attribute specifies the type of pointer (cursor) displayed. Syntax:Object.style.cursor=cursortype
Description | |
---|---|
The URL of the custom cursor to be used |
Note: Please always define a normal cursor at the end of this list in case there is no URL specified Defined available cursors. |
Default cursor (usually an arrow) | |
Default . The cursor set by the browser. | |
The cursor is rendered as crosshairs. | |
The cursor is rendered as a pointer (a hand) indicating the link | |
This cursor indicates that an object can be moved. | |
This cursor indicates that the edge of the rectangular box can be moved to the right (east). | |
This cursor indicates that the edge of the rectangle can be moved up and to the right (North/East). | |
This cursor indicates that the edge of the rectangle can be moved up and to the left (North/West). | |
This cursor indicates that the edge of the rectangular box can be moved up (north). | |
This cursor indicates that the edge of the rectangle can be moved down and to the right (south/east). | |
This cursor indicates that the edge of the rectangle can be moved down and to the left (south/west). | |
This cursor indicates that the edge of the rectangle can be moved down (North/West). | |
This cursor indicates that the edge of the rectangular box can be moved to the left (west). | |
This cursor indicates text. | |
This cursor indicates that the program is busy (usually a watch or hourglass). | |
This cursor indicates available help (usually a question mark or a balloon). |
The above is the detailed content of How to hide the mouse in javascript. For more information, please follow other related articles on the PHP Chinese website!