Home > Web Front-end > JS Tutorial > How to hide the mouse in javascript

How to hide the mouse in javascript

青灯夜游
Release: 2023-01-05 16:09:59
Original
6128 people have browsed it

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.

How to hide the mouse in javascript

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>
Copy after login

Rendering:

How to hide the mouse in javascript

##Description :

# The cursor attribute specifies the type of pointer (cursor) displayed.

Syntax:

Object.style.cursor=cursortype
Copy after login
Possible values:

##ValueurlThe URL of the custom cursor to be useddefaultautocrosshairpointermovee-resizene-resizenw-resizen-resizese-resizesw-resizes-resizew-resizetextwaithelp[Recommended learning:
Description

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).
javascript advanced tutorial

]

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template