Js changes the shape and style of the mouse

  • 2020-03-30 02:28:29
  • OfStack

Most browsers today support a pointer style (move the mouse over the style name to see the pointer style change to that style) :
Auto move no - drop col - resize
All - scroll pointer not - allowed the row - the resize
Crosshair progress e - resize ne - resize
The default text n - resize nw - resize
Help vertical - - the resize text s se - resize
Inherit wait w - resize sw - resize
In Windows Internet explorer 6.0 or later, the style of the pointer above is as follows:
< img SRC = "border = 0 / / files.jb51.net/file_images/article/201403/201403311545372.gif? 201423115460 ">  

To script the mouse pointer style of an element, you can set the element's attribute element.style.cursor to any of the above values. (another alternative to javascript is to use attributes in an element's HTML tag) :
 
function setcursorbyid(id,cursorstyle) { 
if (document.getelementbyid) { 
if (document.getelementbyid(id).style) { 
document.getelementbyid(id).style.cursor=cursorstyle; 
} 
} 
} 

A common way to change the mouse style is to add a cursor to the style of an element if you want to move the mouse over it.

Related articles: