Click to See Complete Forum and Search --> : changing mouse cursor


skriptor
05-19-2003, 02:57 AM
Hi,
I want to change style of cursor while doing some javascript.
I made an example.

<html><head><script language="javascript" type="text/javascript">
function go() {
document.getElementById("info").innerText = self.document.body.style.cursor;
self.setTimeout( "cont1()", 5000 );
}

function cont1() {
self.document.body.style.cursor = "wait";
document.getElementById("info").innerText = self.document.body.style.cursor;
self.setTimeout( "cont2()", 5000 );
}

function cont2() {
self.document.body.style.cursor = "auto";
document.getElementById("info").innerText = self.document.body.style.cursor;
}

</script></head>
<body onload="go()">
hello World, cursor style is: "<span id="info"></span>"
</body></html>

If you start the script move mousecursor into browserwindow and wait. After 5 seconds style is changed but cursor is still 'arrow', you had to move mouse a bit and you get 'hourglas'-style.

Is there a way to change cursorstyle without moving mouse?
Thanks, skriptor.

Fang
05-19-2003, 07:08 AM
An event has to fire to initiate the change; mouseover, keypress etc.

skriptor
05-19-2003, 08:01 AM
Hi Fang,
this sounds easy. I tried some changes to my code, but there was no real solution.

Please could you add a line of code to my example ?

Thank you, skriptor