PDA

View Full Version : cursor change


safalkishore
03-14-2003, 10:03 AM
Im trying to chnage the cursor style to that of an hourglass when some processing is on in the page and set it back to default after that

Eg check below


<html>
<head>
<script language=javascript>
<!--
function showCursor()
{
window.document.body.style.cursor = "wait";
callTimer();
window.document.body.style.cursor = "default";

}

function callTimer()
{

for(i=0;i<10000;i++)
{
window.document.body.style.cursor = "wait";
document.write(i+"<br>");
}
}
//-->
</script>

<title></title>
</head>
<body>
<input type=text name=txt1>
<input type=button name=btn1 value="Click" onclick="showCursor()">
</body>
</html>

wox3-iO
03-14-2003, 11:47 AM
Well I'm a bit of a noob with JavaScript, but I believe that
"window.document.something" is incorrect. Remove that window so it's just "document.style" or "document.body.style".

Roy Sinclair
03-14-2003, 07:28 PM
The document.write in your first call to the callTimer function will terminate your page because document.write to an page which has already finished loading will cause a new page to be started wiping out the original page in the process.