PHP设置进度条的方法
本文实例讲述了PHP设置进度条的方法。分享给大家供大家参考。具体如下:
<html>
<head>
<styletype="text/css"><!--
div{
margin:1px;
height:20px;
padding:1px;
border:1pxsolid#000;
width:275px;
background:#fff;
color:#000;
float:left;
clear:right;
top:38px;
z-index:9
}
.percents{
background:#FFF;
border:1pxsolid#CCC;
margin:1px;
height:20px;
position:absolute;
width:275px;
z-index:10;
left:10px;
top:38px;
text-align:center;
}
.blocks{
background:#EEE;
border:1pxsolid#CCC;
margin:1px;
height:20px;
width:10px;
position:absolute;
z-index:11;
left:12px;
top:38px;
filter:alpha(opacity=50);
-moz-opacity:0.5;
opacity:0.5;
-khtml-opacity:.5
}
-->
</style>
</head>
<body>
<?php
if(ob_get_level()==0){
ob_start();
}
echostr_pad('Loading...',4096)."<br/>\n";
for($i=0;$i<25;$i++){
$d=$d+11;
$m=$d+10;
//Thisdivwillshowloadingpercents
echo'<divclass="percents">'.$i*4.'% complete</div>';
//Thisdivwillshowprogressbar
echo'<divclass="blocks"style="left:'.$d.'px"> </div>';
flush();
ob_flush();
sleep(1);
}
ob_end_flush();
?>
<divclass="percents"style="z-index:12">Done.</div>
</body>
</html>
希望本文所述对大家的php程序设计有所帮助。
热门推荐
1 带狗狗训练
4 听力训练狗狗
6 怎训练狗狗
7 腹肌训练狗狗
8 网球训练狗狗
9 记叙文训练狗狗
10 狗狗太凶怎么训练
11 核心力量训练狗狗
12 狗狗乱叫怎么训练
13 发音训练狗狗
14 怎么训练狗狗叼东西给主人
15 荆州训练狗狗
16 篮球训练狗狗
17 做训练狗狗
18 训练狗狗坐姿