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

global cursor change

P: n/a
Hi everyone,

For an webapp I'm writing I want to set the cursor on 'wait' globally on
the page entire. In IE 6 I can do this by

document.body.style.cursor='wait';

However, Netscape 7 just seems to ignore that. Any ideas how I can make
it work for both browsers?

Thanks,
Vincent

Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Vincent van Beveren wrote:
Hi everyone,

For an webapp I'm writing I want to set the cursor on 'wait' globally on
the page entire. In IE 6 I can do this by

document.body.style.cursor='wait';

However, Netscape 7 just seems to ignore that. Any ideas how I can make
it work for both browsers?

Thanks,
Vincent


<a href="#"
onclick="document.documentElement.style.cursor='wa it';">Test</a>

document.documentElement.style.cursor = 'wait'; works in IE, Firefox 0.9,
Mozilla 1.6 and Opera 7.51. It should work in Netscape 7.01, but Netscape 7
is based on a much earlier version of Mozilla, so it may contain bugs which
keep it from correctly honoring the above.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #2

P: n/a
DU
Vincent van Beveren wrote:
Hi everyone,

For an webapp I'm writing I want to set the cursor on 'wait' globally on
the page entire. In IE 6 I can do this by

document.body.style.cursor='wait';

However, Netscape 7 just seems to ignore that. Any ideas how I can make
it work for both browsers?

Thanks,
Vincent


FWIW,
document.body.style.cursor='wait';
works for me in NS 6.2 and I would be surprised if it was not working in
NS 7.x

DU
Jul 23 '05 #3

P: n/a
> For an webapp I'm writing I want to set the cursor on 'wait' globally on
the page entire. In IE 6 I can do this by

document.body.style.cursor='wait';

However, Netscape 7 just seems to ignore that. Any ideas how I can make
it work for both browsers?


I found out, that it does work,however, it only works for all elements
on the page. So, if I put some text in the body, and I move my cursor
on the text, it does give a wait-cursor. But that is not exactly what
I am looking for. Thanks everyone for giving it a try.

Jul 23 '05 #4

P: n/a
On Wed, 16 Jun 2004 17:23:00 GMT, Grant Wagner
<gw*****@agricoreunited.com> wrote:
document.documentElement.style.cursor = 'wait'; works in IE, Firefox 0.9,
Mozilla 1.6 and Opera 7.51.


What happens with elements with a specific cursor set? they would
still be honoured wouldn't they?

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #5

P: n/a
Jim Ley wrote:
On Wed, 16 Jun 2004 17:23:00 GMT, Grant Wagner
<gw*****@agricoreunited.com> wrote:
document.documentElement.style.cursor = 'wait'; works in IE, Firefox 0.9,
Mozilla 1.6 and Opera 7.51.


What happens with elements with a specific cursor set? they would
still be honoured wouldn't they?

Jim.


Actually, now that I examine the behaviour a little more closely, although it
does the same thing across all browsers, what it does is set the cursor for
the documentElement, not any of the child elements on document.body, which is
probably not the desired outcome.

Ultimately, if the OP's requirements are to set the wait cursor on all
elements, then the only way to be sure you've done that is to navigate through
the entire DOM hierarchy setting .style.cursor = 'wait'; on all elements.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #6

P: n/a
On Mon, 21 Jun 2004 20:34:00 GMT, Grant Wagner
<gw*****@agricoreunited.com> wrote:
Ultimately, if the OP's requirements are to set the wait cursor on all
elements, then the only way to be sure you've done that is to navigate through
the entire DOM hierarchy setting .style.cursor = 'wait'; on all elements.


add an onmousemove event which changes the cursor to WAIT and pushes
the element onto a stack, and when you want to go back, reset all the
elements in the stack, should be better performance than iterating
over them all.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.