Hour Glass Cursor not appearing

A

Aaron Gray

Hi,

I am doing some JavaScript calculations that can take up to one minute and
wanted an hour glass cursor to appear.

The following is not however working on IE 6 or 7

document.body.style.cursor = "wait";

Many thanks in advance,

Aaron
 
V

VK

Aaron said:
Hi,

I am doing some JavaScript calculations that can take up to one minute and
wanted an hour glass cursor to appear.

The following is not however working on IE 6 or 7

document.body.style.cursor = "wait";

Many thanks in advance,

You need to give an "execution pause", otherwise any DOM/style changes
will be applied only after you exit from the function.

function startLongProcess() {
document.body.style.cursor = "wait !important";
window.setTimeout(longProcess, 10);
}

function longProcess() {
// do stuff
document.body.style.cursor = "auto";
}

That is "hard pause" - it works universally everywhere.

Once I tried to use "soft pause", but I was getting mixed results -
mostly unsatisfactory - by different UAs. You may try it first though:

function longProcess() {
window.setTimeout(' document.body.style.cursor = "wait !important"',
10);
// do stuff
document.body.style.cursor = "auto";
}
 
A

Aaron Gray

VK said:
You need to give an "execution pause", otherwise any DOM/style changes
will be applied only after you exit from the function.

function startLongProcess() {
document.body.style.cursor = "wait !important";
window.setTimeout(longProcess, 10);
}

function longProcess() {
// do stuff
document.body.style.cursor = "auto";
}

That is "hard pause" - it works universally everywhere.

Okay I will try this. Thanks.

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top