JS Change the mouse style: JS change the shape and style of the mouse

Source: Internet
Author: User
Tags add

Today most browsers support the pointer style (move the mouse over the style name to observe the pointer style change 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 above is as follows:

To change the mouse pointer style of an element by scripting, you can set the attribute element.style.cursor of an element to any of the above values. (Another way of not using JavaScript is to use attributes in the HTML tag of an element):
function Setcursorbyid (id,cursorstyle) {
if (document.getElementById) {
if (document.getElementById (ID). style) {
document.getElementById (ID). Style.cursor=cursorstyle;
}
}
}
Add a common way to change the mouse style: If you want to move the mouse over an element to change the mouse style, add cursor to the style of the element: (The style you want to change). This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20120605/28269.html

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.