时间:2021-07-01 10:21:17 帮助过:33人阅读
widget('zii.widgets.jui.CJuiProgressBar', array(
'id'=>'progress',
'value'=>0,
'htmlOptions'=>array(
'style'=>'width:200px; height:20px; float:left;'
),
));
?>为了演示进度条,我们使用JavaScripts改变进度条当前值,并使用一个文本显示当前进度条的值。
// Dummy function just to provide an example
Yii::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);
?>
...
以上就是PHP开发框架Yii Framework教程(38) Zii组件-ProgressBar示例的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!