-3
A
回答
0
如果你真的需要它是準確的,你需要繪製它的客戶端,最有可能的。您的PHP腳本可以返回描述進度條位置的JSON對象,然後您的腳本將繪製它。下面是從SO另一個問題是列出了一些JavaScript的圖形選項:Which JavaScript graphics library has the best performance?
0
PHP
$purchased_num = 13; // items purchased until now (example)
$max_width = 400; // the width of the bar
$max_pur = 50; // the maximum number of items
$one_pur_width = round($max_width/$max_pur);
$width = $one_pur_width * $purchased_num;
// print the div with this width
// and style the bar with css
// ...
1
你應該使用jQuery經常重新加載小部分。
<div id="progBar">
</div>
<script type=text/javascript>
function refreshProgress() {
$.get('/folder/progbar.php', function (data) {
$('#progBar').html(data);
}
setTimeout('refreshProgress();',10000);
}
$(function() { refreshProgress(); });
</script>
當加載頁面時會加載progbar.php(這將基於在銷售時的當前進度條)入格,並刷新每10秒。
相關問題
- 1. AppleScriptObjC:進度條不增加
- 2. 進度條增量
- 3. 進度條增量/減量
- 4. ValueError:索引必須單調增加或減少:增加毫秒
- 5. 如何增加UIView的高度,如果兒童的數量增加ios
- 6. 每隔格必須增加其櫃檯
- 7. PHP隨着記錄數量的增加動態增加#行
- 8. Textarea必須重疊div而不增加div高度
- 9. 必須在每個紀元後增加精度嗎?
- 10. PHP:變量不增加
- 11. 進度條 - 按增量暫停0.5秒?
- 12. 增加速度
- 13. 如何增加框架的寬度時的球的數量增加
- 14. 如何增加apache進程或併發php文件的數量?
- 15. 使UIStepper的增量增加5
- 16. PHP增加值
- 17. 增加變量
- 18. 增加變量
- 19. 在javascript函數中增加php變量
- 20. 增加數量,每7天在PHP
- 21. 如何增加「主鍵」自動增加數量?
- 22. 逐步增加數量與使用jQuery
- 23. 使用BIT增加序列的數量
- 24. Mysql的「內存使用量」增加和增加
- 25. 用增量int進行添加
- 26. 當我編寫xml時如何增加進度條?
- 27. 如何獲取遠程文件大小以增加進度條?
- 28. 增加分數數量產生不同的結果在PHP
- 29. 如何增加新線,而使用PHP
- 30. NSToolBar增加高度
你確定PHP是正確的工具嗎? – 2010-07-08 13:10:01