基于jquery 的一个progressbar widge

2020-05-17 06:19:06易采站长站整理

///{3} or {PercentageRemaining} express the remaining percent of the progress bar.
///{4} or {Min} express the min Vlaue of the progress bar.
///{5} or {Max} express the max Value of the progress bar.
///Default:”{1}%”.
///Type:String.
///Code sample:$(‘.selector’).wijprogressbar(‘option’,’labelFormatString’,'{0}%’).
///</summary>
labelFormatString: “{1}%”,
/// <summary>
///Set the format of the ToolTip of the progress bar,the expression of the format like the labelFormatString.
///Default:”{1}%”.
///Type:String.
///Code sample:$(‘.selector’).wijprogressbar(‘option’,’toolTipFormatString’,'{1}%’).
///</summary>
toolTipFormatString: “{1}%”,
/// <summary>
///The increment of the progress bar’s indicator.
///Default:1.
///Type:Number.
///</summary>
///Code sample:$(‘.selector’).wijprogressbar(‘option’,’indicatorIncrement’,10).
indicatorIncrement: 1,
/// <summary>
///The Image’s url of the indicator.
///Default:””.
///Type:String.
///Code sample:$(‘.selector’).wijprogressbar(‘option’,’indicatorImage’,’images/abc.png’).
///</summary>
indicatorImage: “”,
/// <summary>
///The delay of the progressbar’s animation.
///Default:0.
///Type:Number.
///Code sample:$(‘.selector’).wijprogressbar(‘option’,
///</summary>
animationDelay: 0,
/// <summary>
///The options parameter of the jQuery’s animation.
///Default:”{animated:’progress’,duration:500}”.
///Type:Options.
///Code sample:$(‘.selector’).wijprogressbar(‘option’,’animationOptions’,{animated:’progress’,duration:600}).
///</summary>
animationOptions: {
animated: ‘progress’,
duration: 500
}
},
     //when set the options, trigger this method.
_setOption: function (key, value) {
var val, self = this;
switch (key) {
case “value”:
val = parseInt(value);
self.options[key] = val;
self._refreshValue(val);
break;
case “maxValue”:
case “minValue”:
val = parseInt(value);
self.options[key] = val;
self[key === “maxValue” ? “max” : “min”] = val;
self._refreshValue();
break;
case “labelFormatString”:
case “toolTipFormatString”:
self.options[key] = value;
self._refreshValue();
//$.Widget.prototype._setOption.apply(this, arguments);
break;
case “orientation”:
case “fillDirection”:
case “labelAlign”:
case “indicatorImage”:
self.options[key] = value;