Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to set cursor wait when calling a function?

Posted on 2001-06-04
10
Medium Priority
?
293 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

877 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