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.s tyle.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 startLongProces s() {
document.body.s tyle.cursor = "wait !important";
window.setTimeo ut(longProcess, 10);
}
function longProcess() {
// do stuff
document.body.s tyle.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.setTimeo ut(' document.body.s tyle.cursor = "wait !important"',
10);
// do stuff
document.body.s tyle.cursor = "auto";
}