PHP設定進度條的方法_php技巧

來源:互聯網
上載者:User

本文執行個體講述了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><?phpif (ob_get_level() == 0) {  ob_start();}echo str_pad('Loading... ',4096)."<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 . '% 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>

希望本文所述對大家的php程式設計有所協助。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.