setting cursor to wait document-wide

P

PJ6

This is the only solution I've found to get a wait cursor document-wide:

function Busy()
{
if (document.all) for (var i=0;i < document.all.length; i++)
document.all(i).style.cursor = 'wait';
}

Sadly, for pages with a lot of elements, its performance is not acceptable.

Any ideas?

TIA,
Paul
 
J

jshanman

PJ6 said:
This is the only solution I've found to get a wait cursor document-wide:

function Busy()
{
if (document.all) for (var i=0;i < document.all.length; i++)
document.all(i).style.cursor = 'wait';
}

Sadly, for pages with a lot of elements, its performance is not acceptable.

Any ideas?

TIA,
Paul

personally, If a website told me to wait with a "wait" cursor, it would
annoy me. Why not just have an animated message somewhere in the
middle of the screen that says "Processing..." or something. Include a
cancel button that returns to your application if it may take more then
5-10 seconds.
 
E

Evertjan.

PJ6 wrote on 31 jan 2006 in comp.lang.javascript:
This is the only solution I've found to get a wait cursor
document-wide:

function Busy()
{
if (document.all) for (var i=0;i < document.all.length; i++)
document.all(i).style.cursor = 'wait';
}

Sadly, for pages with a lot of elements, its performance is not
acceptable.


function Busy(){

document.body.style.cursor='wait'

zz = document.getElementsByTagName('A')
for (var i=0;i < zz.length; i++)
zz.style.cursor='wait'

zz = document.getElementsByTagName('INPUT')
for (var i=0;i < zz.length; i++)
zz.style.cursor='wait'

}
 
P

PJ6

jshanman said:
personally, If a website told me to wait with a "wait" cursor, it would
annoy me. Why not just have an animated message somewhere in the
middle of the screen that says "Processing..." or something. Include a
cancel button that returns to your application if it may take more then
5-10 seconds.

OK, but one of the operations I want to show a wait state for is page
redirection. AJAX calls such as updating data are very fast, but new page
requests (which may or may not come from back from an AJAX request) are
relatively slow. When I update the page to show a wait state element before
it redirects, I now have that element visible when the user navigates
backward, which is about as acceptable as preventing backwards navigation in
the first place.

I know some people are just going to point out that this post shows that I
obviously don't know what I'm doing; yes, I'm still relatively new at this
but please cut me a little slack (not you, jshanman). My goal is to give the
user a "fast" response to say immediately "yes I'm doing something" on any
action, regardless of how long the server takes. I think it will really
improve user perception of the application's responsiveness. Since I have a
library of controls, the more globally I approach this problem the better.

Paul
 
B

BootNic

PJ6 said:
This is the only solution I've found to get a wait cursor
document-wide:

function Busy()
{
if (document.all) for (var i=0;i < document.all.length; i++)
document.all(i).style.cursor = 'wait';
}

Sadly, for pages with a lot of elements, its performance is not
acceptable.

Any ideas?

<script type="text/javascript">
function Busy(){
document.body.className=(document.body.className=='wait')?'':'wait';
}
</script>
<style type="text/css">
..wait,.wait *{
cursor: wait;
color:#F5F5F5;
background-color:#FFC0CB;
}
</style>
 

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

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top