By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

Hour Glass Cursor not appearing

P: n/a
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
Jan 3 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
VK

Aaron Gray wrote:
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";
}

Jan 3 '07 #2

P: n/a
"VK" <sc**********@yahoo.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
>
Aaron Gray wrote:
>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.
Okay I will try this. Thanks.

Aaron
Jan 4 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.