Since JS tends to be problematic -- my current client requires it be turned off, for example -- here's an idea of how to acccomplish this with CSS.
/* Stylesheet Snippet */ .pbcont { background-color: #000; height: 20px; width: 250px; border: 1px solid #00c; margin: 0; padding: 0; } .pbarchunk { margin: 0; margin-right: 2px; padding: 0; background-color: #00c; width: 23px; height: 20px; }
#!/usr/bin/perl use CGI; # Do CGI stuff # Print a lot of the HTML; print "<div class='pbcont'>"; while ($new_val < 100) { $new_val = &update(); # get the updated progress next unless $new_val > $old_val; print "<div class='pbar'> </div>"; } print "</div>\n";
This is untested, but the basic idea is that writing the DIVs will cause colored blocks to appear inside a bordered bar. One could also get a lot more complicated, dealing with fractional percentages, absolute CSS positioning to make the progress bar go away, and other neat little tricks.
Of course, if all you're interested in is letting the user know "something is happenning", you can use the parent post's idea with an animated GIF. This is basically what sites like PriceLine and the like use.
radiantmatrix
require General::Disclaimer;
s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}
In reply to Re^2: Timer - Progress Bar
by radiantmatrix
in thread Timer - Progress Bar
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |