sad69
04-19-2004, 11:13 PM
Hi all,
Just wondering if anyone has ever written a computational function that takes a while to run, and has ever considered changing the mouse cursor to the hourglass while the function is running.
I tried... no success. I'm not sure what I'm doing wrong either! This is essentially the format of the code -- if you know what's wrong, please let me know!
function longFunction() {
document.body.style.cursor = "wait";
...
document.body.style.cursor = "auto";
}
My code only needs to run in IE. There are no return statements within the function either.
PS. I've found that when my function fails -- so there's a Javascript error midway -- it kicks out the function, so as not to execute the line of code changing the cursor back to "auto". At this point the cursor becomes the hourglass! So it works, just not when I want it to...
Thanks in advance,
Sadiq.
Just wondering if anyone has ever written a computational function that takes a while to run, and has ever considered changing the mouse cursor to the hourglass while the function is running.
I tried... no success. I'm not sure what I'm doing wrong either! This is essentially the format of the code -- if you know what's wrong, please let me know!
function longFunction() {
document.body.style.cursor = "wait";
...
document.body.style.cursor = "auto";
}
My code only needs to run in IE. There are no return statements within the function either.
PS. I've found that when my function fails -- so there's a Javascript error midway -- it kicks out the function, so as not to execute the line of code changing the cursor back to "auto". At this point the cursor becomes the hourglass! So it works, just not when I want it to...
Thanks in advance,
Sadiq.