Return to Snippet

Revision: 23856
at March 8, 2010 02:51 by cfleschhut


Updated Code
<div id="progress" style="background: green; width: 0;">&nbsp;</div>
<p><a href="#" onclick="progress(); return false;">start</a></p>

function progress() {
    var loadingbar = document.getElementById("progress");
    var width = parseInt(loadingbar.style.width);
    width++;
    loadingbar.style.width = width + "px";
    if (width < 300) {
        setTimeout(progress, 10);
    }
}

Revision: 23855
at March 8, 2010 02:50 by cfleschhut


Updated Code
<div id="progress" style="background: green; width: 0;">&nbsp;</div>
<p><a href="#" onclick="progress(); return false;">start</a></p>


function progess() {
    var loadingbar = document.getElementById("progress");
    var width = parseInt(loadingbar.style.width);
    width++;
    loadingbar.style.width = width + "px";
    if (width < 300) {
        setTimeout(progess, 10);
    }
}

Revision: 23854
at February 15, 2010 13:56 by cfleschhut


Initial Code
<div id="progress" style="background: green; width: 0;">&nbsp;</div>


function progess() {
    var loadingbar = document.getElementById("progress");
    var width = parseInt(loadingbar.style.width);
    width++;
    loadingbar.style.width = width + "px";
    if (width < 300) {
        setTimeout(progess, 10);
    }
}
progess();

Initial URL
http://jsfiddle.net/YR9fd/4/

Initial Description


Initial Title
Basic JavaScript Progressbar Animation

Initial Tags
javascript, animation

Initial Language
JavaScript