一、class加載方式
<div id="pos" class="easyui-progressbar" data-options="value:60" style="width: 200px;"></div>
二、js加載方式
$("#pos").progressbar({
//屬性
width:600,//設置進度條寬度。默認為 auto,值為string
height:30,//設置進度條高度。默認為 22,值為number
value:10,// 設置進度條值。默認為 0,值為number
text:'{value}%',//設置進度條百分比模版:默認{value}%,值為string
//事件
onChange:function (newValue,oldValue) {
console.log("新值:"+newValue+",舊值:"+oldValue)
},
});
//方法
console.log($('#pos').progressbar('options'));//返回屬性對象 參數none
//$("#pos").progressbar('setValue',80); //設置一個新的進度值,參數value
$("#pos").progressbar('resize',500);// 組件大小,參數width
setInterval(function() {
$("#pos").progressbar('setValue',$("#pos").progressbar('getValue')+1)//返回當前進度值,參數none
},200)
三、可以使用$.fn.resizable.defaults 重寫默認值對象
