In the way it’s cross-browser, using JavaScript only.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think the issue you’re having is that the
bodyelement isn’t filling the viewport because there isn’t much content on the page (this is especially true on IE). You can force it to fill the viewport with CSS:…which then ensures the cursor is a pointer anywhere in the viewport.
Edit: And having ensured that the
bodyelement fills the viewport, you can use thestyleobject on thedocument.bodyto set the cursor from JavaScript. So to change it to a crosshair:If you can’t apply CSS at all in advance, this seems to work: