进度条jquery效果

1.

/*
jQuery.loanPlanNum = function(tag,len) {
var $loanPlan = jQuery(tag);
for(var i = 0; i< $loanPlan.length; i++){
var text = $loanPlan.eq(i).text();
var index = text.lastIndexOf("%");
text = text.slice(0,index);
text = parseInt(text,10);
text = Math.floor(text/10);
var numLoan = text * len;
$loanPlan.eq(i).html(text*10+"%");
$loanPlan.eq(i).css({"backgroundPositionX": -numLoan + "px"});
}
};
jQuery.loanPlanNum(".bidProgress","277");
*/

2.


(function($) {
$.fn.progressBar = function(options) {
var opts = $.extend(true, {},
$.fn.progressBar.defaults, options);
return this.each(function() {
var $this = $(this);
var text = $this.text(),
index = text.lastIndexOf("%"),
numLoan;
text = text.slice(0,index);
text = parseInt(text,10);
text = Math.floor(text/10);
numLoan =text*opts.barLength;
$this.html(text*10+"%");
$this.css({"backgroundPositionX": -numLoan + "px"});
});
};
$.fn.progressBar.defaults = {
barLength:230
};
})(jQuery);

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。