Solved

How to set cursor wait when calling a function?

Posted on 2001-06-04
10
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

687 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