首页 > 编程教程 > PHP > 正文

php+html做的进度条

2019-03-08 PHP集中营 gramer 点击: 评论
效果展示代码<!DOCTYPE html PUBLIC "- W3C DTD XHTML 1 0 Transitional EN" "http: www w3 org TR xhtml1 DTD xhtml1-tran

天晟网 小编在整理编程教程 > PHP > 看到php+html做的进度条,下面是小编45为您找到的37972相关内容,希望45对您有帮助。

效果展示

代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>php+html做的进度条 CMS集中营 www.timsion.com</title>
<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>
<?php
if (ob_get_level() == 0) {
    ob_start();
}
echo str_pad('Loading... ',4096)."<br />n";
$d = 0;
for ($i = 0; $i < 25; $i++) {
    $d = $d + 11;
    $m = $d + 10;
    //This div will show loading percents
    echo '<div class="percents">' . $i*4 . '% complete</div>';
    //This div will show progress bar
    echo '<div class="blocks" style="left: '.$d.'px"> </div>';
    flush();
    ob_flush();
    sleep(1);
}
ob_end_flush();
?>
<div class="percents" style="z-index:12">Done.</div>
</body>
</html>

转载文章请标明来自天晟网 - Timsion.com > 编程教程 > PHP >
标题:php+html做的进度条
网址:http://www.timsion.com/php/37972.html

关键词:进度条

上一篇:PHP中基本符号及使用方法
下一篇:php将敏感词替换为*的方法

免责声明:以上内容来自互联网和用户投稿,不代表本站的观点和立场,版权归原作者所有,如有侵权,请与我们联系。