Here it is in jsfiddle: http://fiddle.jshell.net/5j6gf/1/
The answer of how to animate in javascript was from here: https://stackoverflow.com/a/11213374/1524085
function animate(elem,style,unit,from,to,time) {
if( !elem) return;
var start = new Date().getTime(),
timer = setInterval(function() {
var step = Math.min(1,(new Date().getTime()-start)/time);
elem.style[style] = (from+step*(to-from))+unit;
if( step == 1) clearInterval(timer);
},25);
elem.style[style] = from+unit;
}
animate(
document.getElementById('progress-bar'),
"width","%",0,100,1000
);