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
newbee2MFCAsked:
Who is Participating?
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.