mouse cursor problem !!

B

Brami Yair

Hi,

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.

thanks,
 
E

Evertjan.

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";
}
 

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
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top