Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Progress Bar Question 1

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
the progress bar that i have is working for a fixed time period (30 seconds). i want to be able to stop the progress bar when the page that i'm loading has finished loading. how can i tell if the page has completely loaded? i can use some help on that. the code for progress bar looks like this:
Code:
<p>Displays progress bar in status bar and/or in a div in the page as required.</p>

<p><b><font color = "blue"></p>
<div id = "pbar"></div></b></font>

<script type = "text/javascript">
var percent = 10;   // adjust starting value to suit
var timePeriod = 150;  // adjust milliseconds to suit

function getBar() {
var retBar = '';
for (i = 0; i < percent; i++) {
retBar += "|";
}
return retBar;
}

function progressBar() {
if (percent < 100) {
percent = percent + 1;
document.getElementById("pbar").innerHTML = "&nbsp &nbsp &nbsp &nbsp Loading : " + percent + "%" + " " + getBar();
window.status = "Loading : " + percent + "%" + " " + getBar();
setTimeout ("progressBar()", timePeriod);
}
else {
document.getElementById("pbar").innerHTML = "";
window.status = "Your message here";
document.body.style.display = "";
}
}
progressBar();
</script>
thanks for help.
 
thanks bhuninghake.
my question is: there's a message that says: "please be patient, your request is being processed." where would this message go?
the page that i'm loading has a link to paypal logo that displays a paypal link to take the user to paypal login screen. it takes quite a long time for the paypal logo to appear. while this is going on, i like to display a progress bar or a message. when the link (logo) is displayed, i would like to end the progress bar or erase the message.
thanks for any help.

 
Looking at the code notice the
Code:
<div id="showMessage"></div>
tag ... You should be able to place this where ever you want the message to appear and it should disappear once the page loads. Hope this helps in answering your question.
 
bhuninghake,
thanks. i got it to work. when the page loads, the gif stops and the message goes away.
this is great.
you deserve a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top