/ Published in: JavaScript
URL: http://jsfiddle.net/YR9fd/4/
Expand |
Embed | Plain Text
<div id="progress" style="background: green; width: 0;"> </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); } }
You need to login to post a comment.
