<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>播放控制栏</title>
<script src="playctrlbar.js" type="text/javascript"></script>
<script>
var cb=new Ctrlbar();
var totaltime=200;
var cutime=1;
var savetime=1;
function load()
{
document.body.appendChild(cb.createbar(null));
cb.setbarwh(600,30);
setInterval("testfun()",1000);//1000为1秒钟
}
function testfun()
{
cutime+=4;
if(cutime>=totaltime)
cutime=totaltime;
var t1=cutime/totaltime;
savetime+=6;
if(savetime>=totaltime)
savetime=totaltime;
var t2=savetime/totaltime;
cb.drawrun(t1,t2,false);
if(cutime==totaltime)
{
cutime=1;
savetime=1;
}
}
</script>
</head>
<body onLoad="load()" style="background:#fff; width:800px; height:300px; position:relative";>
<!--div style="background:yellow; width:200px; height:50px">
nihao
</div>-->
</body>
</html>