Einzelnen Beitrag anzeigen
Alt 12.09.2004, 22:46   #2
Biri
Hero
 
Registriert seit: 04.09.2001
Beiträge: 894


Standard

hi !

für javascript hab ich dazu folgendes (bei www.codeproject.com) befunden:

JavaScript can be used to do some nifty client-side things, like changing the cursor. In fact, the solution is so simple, it's only about 2 lines of code.

All you need to do is to write a function like this:

function doHourglass()
{
document.body.style.cursor = 'wait';
}
Quite simple huh?

The next step is to get the web form to call that function when a post back occurs. Well, that is another very simple addition. This time, just add an event handler to your body tag in your page.

<body onbeforeunload="doHourglass();" onunload="doHourglass();">

Points of Interest
The first question you're probably asking is, "Why is there both an onbeforeunload and an onunload event handler?"
The reason for that is that if your app is being viewed in IE, it seems to prefer the onbeforeunload, whereas other browsers seem to prefer the onunload.

You might also be asking why there is no code to set the cursor back. Well, mainly because there is no need for it. As far as the browser is concerned, this is a new page, so it sets the mouse cursor back to the default pointer.
Biri ist offline   Mit Zitat antworten