Solved

How to set cursor wait when calling a function?

Posted on 2001-06-04
10
284 Views
Last Modified: 2011-08-18
I have a function in my page, that orders a HTML table with Javascript by changing the row positions. When the table is big, the ordering takes some seconds and I would like the cursor to go hourglass.

I've tried to call:
     document.body.style.cursor="wait";

but the cursor only goes hourglass after the function has finished.
0
Comment
Question by:RobertoTY
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 6153722
function doIt()
   document.body.style.cursor="wait";
   setTimeout('realFunction()',100);
}

function realFunction(){
.
.
.
.
   document.body.style.cursor=...
}
0
 

Author Comment

by:RobertoTY
ID: 6153997
about the last comment:

Using this, I will face another problem.
Inside the real function I'll have to call event.srcElement inside the "real function".

It doesn't work if I use setTimeout.
0
 

Author Comment

by:RobertoTY
ID: 6154026
about the last comment:

Using this, I will face another problem.
Inside the real function I'll have to call event.srcElement inside the "real function".

It doesn't work if I use setTimeout.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
ID: 6154070
Why? WHat are you trying to do?

Anyway

lastEvent = "";
function doIt()
  document.body.style.cursor="wait";
  lastEvent = event;
  setTimeout('realFunction()',100);
}

function realFunction(){
   lastEvent.srcElement...
.
.
.
.
  document.body.style.cursor=...
}
0
 

Author Comment

by:RobertoTY
ID: 6154152
function sortColumn(pDescending)
{
  document.body.style.cursor="wait";
  setTimeout('realFunction',100);
}

function realFunction() {
   var tmp, el, tHeadParent,pDescending;
   
   if (ie5)
      tmp = window.event.srcElement ;
   else if (dom)
      tmp = window.event.srcElement;

   tHeadParent = getParent(tmp, "THEAD");

   el = getParent(tmp, "TD");
   

An error occurs when the call to srcElement property is made.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 6154169
Try it my way then

Michel
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7811059
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 7812917
Points, please
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7909574
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to mplungjan

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7958241
Comment from expert accepted a answer

Computer101
E-E Admin
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question