Forum Moderators: open
I have a function that loops through a large number of Divs and searching for text to highlight when a search is performed. I am wanting to update the cursor to the "wait" state at the beginning of the function and then turn it back to "auto" at the end. Nothing gets updated until the function is finished.
You should be able to change the cursor as the first line of the function and change it back as the final line of the function.
What I prefer to do is to have a div pop up with a 'please wait' message. Here is an example that I use when sorting HTML tables:
The CSS:
#sortDiv{
position: absolute;
top: 200px;
left:0px;
text-align:center;
display:none;
font-size: 1.4em;
width: auto;
z-index:500;
background-color:#fffacd;
border: 1px solid black;
padding: .2em .2em .2em .2em;
margin-left: 13%;
margin-right: 13%;
width: 70%;
}
The JS:
//beginning of function code
document.getElementById('sortDiv').style.display="block";
...
your function here
...
//end of function code
document.getElementById('sortDiv').style.display="none";
The HTML:
<div id="sortDiv"><span id="mySpan">Please wait—sorting table.</span></div>
Hope this helps,
ajkimoto