How would one go about making a progress bar in html/css/javascript. I don't really want to use Flash. Something along the lines of what can be found here: http://dustincurtis.com/about.html
All I really want is a 'progress bar' that changes to the values I give in PHP. What would be your though process? Are there any good tutorials on this?
Step 2: Add the Progress Bars Next, highlight the cell range B2:B11 that contains the progress percentages, then click the Conditional Formatting icon on the Home tab, then click Data Bars, then click More Rules: A new window appears that allows you to format the data bars.
Use the <progress> tag to create a progress bar in HTML. The HTML <progress> tag specifies a completion progress of a task. It is displayed as a progress bar. The value of progress bar can be manipulated by JavaScript.
You can do it by controlling the width of a div via css. Something roughly along these lines:
<div id="container" style="width:100%; height:50px; border:1px solid black;">
<div id="progress-bar" style="width:50%;/*change this width */
background-image:url(someImage.png);
height:45px;">
</div>
</div>
That width value can be sent in from php if you so desire.
If you are using HTML5 its better to make use of <progress>
tag which was newly introduced.
<progress value="22" max="100"></progress>
Or create a progress bar of your own.
Example written in sencha
if (!this.popup) {
this.popup = new Ext.Panel({
floating: true,
modal: false,
// centered:true,
style:'background:black;opacity:0.6;margin-top:330px;',
width: '100%',
height: '20%',
styleHtmlContent: true,
html: '<p align="center" style="color:#FFFFFF;font-size:12px">Downloading Data<hr noshade="noshade"size="7" style="color:#FFFFFF"></p>',
});
}
this.popup.show('pop');
http://jqueryui.com/demos/progressbar/
Check that out, it might be what you need.
You can use progressbar.js;
Animated progress bar control and tiny chart (sparkline)
Demo and download link
HTML usage;
<div id="my-progressbar"></div>
Javascript usage;
var progressBar;
window.onload = function(){
progressBar = new ProgressBar("my-progressbar", {'width':'100%', 'height':'3px'});
progressBar.setPercent(60);
}
Basically its this: You have three files: Your long running PHP script, a progress bar controlled by Javascript (@SapphireSun gives an option), and a progress script. The hard part is the Progress Script; your long script must be able to report its progress without direct communication to your progress script. This can be in the form of session id's mapped to progress meters, a database, or check of whats not finished.
The process is simple:
I tried a simple progress bar. It is not clickable just displays the actual percentage. There's a good explication and code here: http://ruwix.com/simple-javascript-html-css-slider-progress-bar/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With