この
(function($) {
jQuery.fn.fillProgressBar = function(option){
var settings = jQuery.extend({
fromValue : 0,
toValue : 0,
interval : 1000
},option);
function fillProgressBar(element,initialValue,toValue,interval){
// console.log("out "+initialValue);
if(initialValue<=toValue){
/* $j(element).progressbar({
value : initialValue++
});*/
$j(element).progressbar("value", initialValue++);
// console.log(initialValue);
setTimeout(function(){
fillProgressBar(element,initialValue,toValue,interval);
}, parseInt(interval/toValue));
// console.log("in "+initialValue);
}
}
fillProgressBar(this,settings.fromValue,settings.toValue,settings.interval);
return this;
};})(jQuery);
のような機能を作成し、それをやる
$j("#progressBar").progressbar({
value:0 });
$j("#progressBar").fillProgressBar({toValue : progressBarValue,
interval : 1000});
として呼び出しを行います。ありがとう。 :) –