change mouse pointer

How do I change the mouse pointer to an hourglass, then back to normal?  
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
0
 
käµfm³d 👽Commented:
Use CSS:
.showHourglass
{
    cursor: wait;
}

.showNormal
{
    cursor: default;
}

Open in new window

0
 
RickCommented:
Sub Processing()

   'Processing request:
   div1.style.add("cursor", "wait")
   ...

   'Finished processing request:
   div1.style.add("cursor", "default")  

End Sub
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
HLRosenbergerAuthor Commented:
Can I do this from Javascipt?
0
 
käµfm³d 👽Commented:
Can I do this from Javascipt?
CodeCruiser's link demonstrates a javascript approach.
0
 
Kalpesh ChhatralaSoftware ConsultantCommented:
use below javascript to change Mouse Pointer

<script language="javascript">
function hourglass()
{
    document.body.style.cursor = "wait";
}
</script>

Open in new window

0
 
Mohamed AbowardaSoftware EngineerCommented:
Javascript - Mouse Cursor Styles:
http://www.javascripter.net/faq/stylesc.htm
0
 
Rose BabuSenior Team ManagerCommented:
Try this,

function changeCursor(elemID,Style) {
 var elem;
 if (document.getElementById &&
    (elem=document.getElementById(elemID)) ) {
  if (elem.style) elem.style.cursor=Style;
 }
}

// Change Cursor
changeCursorByID('id1','wait')

Open in new window


Happy Programming.
0
 
CodeCruiserCommented:
HLRosenberger

The code that you have accepted is almost the same as in the link I posted BEFORE that comment. And the selected code does not show you how to use that function. Explanation plz.
0
 
käµfm³d 👽Commented:
Sorry CodeCruiser...  I tried : (    (http:#35723880).
0
 
CodeCruiserCommented:
Thanks kaufmed :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.