Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Hour Glass Cursor not appearing

Reply
Thread Tools

Hour Glass Cursor not appearing

 
 
Aaron Gray
Guest
Posts: n/a
 
      01-03-2007
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


 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      01-03-2007

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

 
Reply With Quote
 
 
 
 
Aaron Gray
Guest
Posts: n/a
 
      01-04-2007
"VK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
Setting the cursor to the Hour Glass Greg Smith ASP .Net 1 04-12-2007 06:03 PM
no hour glass appears when booting up Firefox. aaronep@pacbell.net Firefox 1 11-24-2005 12:59 AM
hour glass will not go away Duane Arnold Computer Support 6 11-20-2005 09:59 PM
Hour glass while web app is busy =?Utf-8?B?UGF1bA==?= ASP .Net 4 11-11-2004 06:09 PM



Advertisments