Brami Yair wrote on 08 jul 2004 in comp.lang.javascript
:
below is example js:
function SomeLongProcess()
{
for(var i=0;i<document.all.length;i++)
document.all(i).style.cursor="wait";
// some long process here !!
for(var i=0;i<document.all.length;i++)
document.all(i).style.cursor="default";
}
so, the problem is, that the mouse cursor not change, until i focus to
different window, and return to this window.
try asyngronous code:
function myWait(){
for(var i=0;i<document.all.length;i++)
document.all(i).style.cursor="wait";
}
function myDefault(){
for(var i=0;i<document.all.length;i++)
document.all(i).style.cursor="default";
}
function SomeLongProcess(){
setTimeout('myWait()'),50)
// some long process here !!
setTimeout('myDefault()'),50)
}
not tested, btw.
==========
Why not:
function myWait(){
document.body.style.cursor="wait";
}
function myDefault(){
document.body.style.cursor="default";
}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)