Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / January 2006



Tip: Looking for answers? Try searching our database.

setting cursor to wait document-wide

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PJ6 - 31 Jan 2006 15:36 GMT
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
jshanman - 31 Jan 2006 16:01 GMT
> This is the only solution I've found to get a wait cursor document-wide:
>
[quoted text clipped - 10 lines]
> 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.
PJ6 - 31 Jan 2006 16:21 GMT
> 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
Evertjan. - 31 Jan 2006 16:02 GMT
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:
[quoted text clipped - 7 lines]
> 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[i].style.cursor='wait'

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

}

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

BootNic - 31 Jan 2006 19:02 GMT
> "PJ6" <nobody@nowhere.net> wrote:
> news:guLDf.5270$J81.2746@trndny01....
[quoted text clipped - 12 lines]
>
> 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>

Signature

BootNic   Tuesday, January 31, 2006 2:01 PM

The world is very different now. For man holds in his mortal hands the power to abolish all forms of human poverty, and all forms of human life.
*John Fitzgerald Kennedy, Inaugural Address*

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.