DDR爱好者之家 Design By 杰米

本文实例讲述了PHP设置进度条的方法。分享给大家供大家参考。具体如下:

<html>
<head>
<style type="text/css"><!--
div {
 margin: 1px;
 height: 20px;
 padding: 1px;
 border: 1px solid #000;
 width: 275px;
 background: #fff;
 color: #000;
 float: left;
 clear: right;
 top: 38px;
 z-index: 9
}
.percents {
 background: #FFF;
 border: 1px solid #CCC;
 margin: 1px;
 height: 20px;
 position:absolute;
 width:275px;
 z-index:10;
 left: 10px;
 top: 38px;
 text-align: center;
}
.blocks {
 background: #EEE;
 border: 1px solid #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>
<"<br />\n";
for ($i = 0; $i < 25; $i++) {
  $d = $d + 11;
  $m=$d+10;
  //This div will show loading percents
  echo '<div class="percents">' . $i*4 . '%&nbsp;complete</div>';
  //This div will show progress bar
  echo '<div class="blocks" style="left: '.$d.'px">&nbsp;</div>';
  flush();
  ob_flush();
  sleep(1);
}
ob_end_flush();
"percents" style="z-index:12">Done.</div>
</body>
</html>

希望本文所述对大家的php程序设计有所帮助。

DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米