Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4671
  • Last Modified:

Change cursor shape

I know one can change cursor type by assign .style.cursor="hand";

The question is how to change the cursor type if I do not know the element.   I just want to change current cursor type as some time consuming calculation is needed in the JavaScript.

Thanks
g
0
newbee2MFC
Asked:
newbee2MFC
  • 3
1 Solution
 
NushiCommented:
CSS:

The same just use the body css.
0
 
NushiCommented:
you can still catch the element who caused the action if its helping you.

and then change the cursor.
0
 
newbee2MFCAuthor Commented:
What I want to do is to change cursor shape during the execution of javascript function, for example

function myFun()
{
var mycursor = document.body.style.cursor;
document.body.style.cursor = "hand";
"dosome really long work."
document.body.style.cursor = mycursor;
}

I expect the cursor shape would change after the excution of the first line, which does not.   Cursor shap change only after the function complete.

Is there a way to accomplish this?

0
 
NushiCommented:
hi there.

so do a small trick to fix it.
from the location that calls the function
event...="document.body.style.cursor='hand';myFun()"

Nushi.

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now