Wrox Programmer Forums
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
Old October 21st, 2003, 02:27 PM
Authorized User
Join Date: Aug 2003
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


Old October 22nd, 2003, 03:12 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

Yes, but with a big proviso. Firstly you can set the cursor using style:
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:
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.





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.