C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Javascript »

How to change cursor type to Hour Glass


Posted Date: 23 Dec 2008    Resource Type: Code Snippets    Category: Javascript
Author: Puja SharmaMember Level: Gold    
Rating: 1 out of 5Points: 25



Very recently I saw a forum message asking for help related to mouse cursor.

Problem


Problem was that when cursor is on page, it is showing the wait cursor that is Hour glass icon but in button it is showing the normal arrow icon. Right...

Solution


The solution is very simple.. If you want user to see wait cursor on button also, you have to set the style.cursor property of the buttons also.
So next question is that if you have so many buttons , so will you write so many lines..No.

see the function below:


function cursor_wait()
{
document.body.style.cursor = 'wait';
var x=document.getElementsByTagName("input");
for (var i=0;i<x.length;i++)
{ x[i].style.cursor='wait';
}
}


Code Description



1.This code first change the page icon to wait.
2. Searches for all the Tag named input
3. For all the controls, it sets the icon to wait...

You can very easily write a function that performs the reverse step.

Feel free to contact me if any queries

Regards
Varun Sharma



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
On page  .  Javascript  .  Hour glass  .  Button  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Javascript for email validation
Previous Resource: To Calculate Leave Days
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use