<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Progress Bar Demo</title>
<style type="text/css">
@import "http://o.aolcdn.com/dojo/1.0/dijit/themes/tundra/tundra.css";
@import "http://o.aolcdn.com/dojo/1.0/dojo/resources/dojo.css"
</style>
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.0/dojo/dojo.xd.js"
djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dijit.ProgressBar");
dojo.require("dojo.parser");
function download(){
// Split up bar into 7% segments
numParts = Math.floor(100/7);
jsProgress.update({ maximum: numParts, progress:0 });
for (var i=0; i<=numParts; i++){
// This plays update({progress:0}) at 1nn milliseconds,
// update({progress:1}) at 2nn milliseconds, etc.
setTimeout(
"jsProgress.update({ progress: " + i + " })",
(i+1)*100 + Math.floor(Math.random()*100)
);
}
}
</script>
</head>
<body class="tundra">
<div dojoType="dijit.ProgressBar" style="width:300px"
jsId="jsProgress" id="downloadProgress"></div>
<input type="button" value="Go!" οnclick="download();" />
</body></html>
See the API docs for more information on update().
goole progressbar
最新推荐文章于 2024-09-12 19:13:21 发布