PHP开发框架Yii Framework教程(38) Zii组件-ProgressBar示例2013-02-03 csdn mapdigitCJuiProgressBar显示一进度条。它封装了 JUI Progressbar插件。CJuiProgressBar显示一进度条。它封装了 JUI Progressbar插件。
<?php $this->widget("zii.widgets.jui.CJuiProgressBar", array( "id"=>"progress","value"=>0,"htmlOptions"=>array("style"=>"width:200px; height:20px; float:left;" ),));?>
为了演示进度条,我们使用JavaScripts改变进度条当前值,并使用一个文本显示当前进度条的值。
<?php//Dummy function just to provide an exampleYii::app()->clientScript->registerScript("scriptId", "var count = 0;var step= 10;var speed = 500;function progress() {$("#amount").text(count+"%");$("#progress").progressbar("option", "value", count);if(count < 100) {count = count+step;setTimeout(progress, speed);}}progress();", CClientScript::POS_LOAD);?>...<center id="amount" style="margin-left:210px; padding:3px;"></center>
查看全套教程:http://www.bianceng.cn/webkf/PHP/201301/35265.htm本例下载:http://www.imobilebbs.com/download/yii/JuiDialogDemo.zip