How js changes the shape and style of the mouse

Source: Internet
Author: User

Most browsers currently support pointer styles (move the mouse over the style name to observe the style changed to that style ):
Auto move no-drop col-resize
All-scroll pointer not-allowed row-resize
Crosshair progress e-resize ne-resize
Default text n-resize nw-resize
Help vertical-text s-resize se-resize
Inherit wait w-resize sw-resize
In windows internet explorer 6.0 or later, the pointer style is as follows:
 

To change the mouse pointer style of an element through a script, you can set the attribute element. style. cursor of the element to any value above. (Another method without javascript, you can use attributes in the html Tag of an element ):
Copy codeThe Code is as follows:
Function setcursorbyid (id, cursorstyle ){
If (document. getelementbyid ){
If (document. getelementbyid (id). style ){
Document. getelementbyid (id). style. cursor = cursorstyle;
}
}
}

Add a common method to change the mouse style: If you want to move the mouse over an element, change the mouse style and add cursor to the style of the element: (the style you want to change ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.