Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 21st, 2003, 02:27 PM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default hide cursor

hi all

can I hide and show the cursor in my web page using DHTML techniques ? I want to hide the cursor on some points and again show it again later

thanks

  #2 (permalink)  
Old October 22nd, 2003, 03:12 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Yes, but with a big proviso. Firstly you can set the cursor using style:
Code:
document.body.style.cursor = "wait"; //Hourglass
This can be on virtually any element. The proviso is that it won't change unless the script finishes so you probably need to use setTimeout, let's say your user clicks a button that needs to call updateDatabase. Set your onclick to call an intermediary function called longProcess:
Code:
function setCursor(Cursor)
{
  document.body.style.cursor = Cursor;
}
function longProcess()
{
  setTimeout("setCursor'wait')", 100);
  setTimeout(updateDatabase, 500);  
}
You can set the cursor back at the end of updateDatabase.

See:

http://msdn.microsoft.com/library/de...de02262001.asp

--

Joe


Similar Threads
Thread Thread Starter Forum Replies Last Post
Magnetic Cursor - Target Area Cursor? gcarcass .NET Framework 2.0 1 May 5th, 2008 07:20 AM
Hide Cursor Blinking in textbox VB.NET asadullah Visual Studio 2005 0 October 6th, 2007 06:36 AM
Regarding Cursor param99 SQL Server 2000 1 September 8th, 2006 10:03 AM
Regarding Cursor param99 SQL Language 0 September 8th, 2006 03:56 AM
cursor trinnie SQL Server 2000 0 August 6th, 2006 09:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.