Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Hour Glass pointer 1

Status
Not open for further replies.

agape234

Programmer
Oct 10, 2001
128
US
I want to have the mouse pointer change to an animated hour glass when I select a link on a page.
I am a newbie at this HTML stuff....I have a web page that has links to some perl scripts that access some dbs and files systems. These scripts can take a few seconds to 2O seconds to complete. I want the mouse pointer to change to an animated gif of an hour glass or something similar while it executes.
Can you help me with this coding.
 
This should work for you:
Put this in the HEAD
Code:
<SCRIPT>
function changeCursor()
{
	document.body.style.cursor = &quot;wait&quot;;
}
</SCRIPT>

Put this on your link
Code:
<A HREF=&quot;your_script.cgi&quot; onclick=&quot;changeCursor()&quot;>link</A>
Einstein47
(&quot;The only reason I would take up exercise would be so I could hear heavy breathing again.&quot;)
 
OK, I have a server running IIS and the hour glass appears by default on the web pages from that box. Is there a global setting that would put that feature (hour glass) into all of the pages a particular server. Is it an IIS thing or just a setting on all of the pages? The hour glass appears when any link is selected.

I have another server that I have built the pages from scratch, they are very basic, no graphics or complex coding. This one does not have the hour glass when I click on my links. This server is running Apache.
 
Refreshing the page would be the fastest (easiest) way.

You could create another javascript function to change the cursor back to &quot;auto&quot; or &quot;default&quot; (I believe that both do the same thing).

Or if you only wanted the &quot;wait&quot; cursor for a certain time, modify the code I have above to this:
Code:
<SCRIPT>
function changeCursor()
{
    document.body.style.cursor = &quot;wait&quot;;
    // the timeout is number of seconds * 1000
    setTimeout('document.body.style.cursor = &quot;default&quot;;', 9000);
}
</SCRIPT>

The valid values for cursor are: auto, crosshair, default, e-resize, help, move, n-resize, ne-resize, nw-resize, pointer, s-resize, se-resize, sw-resize, text, w-resize, wait.

Have fun! :) Einstein47
(&quot;The only reason I would take up exercise would be so I could hear heavy breathing again.&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top