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

mouse cursor problem !!

P: n/a
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,
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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)
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.