码迷,mamicode.com
首页 > Web开发 > 详细

进度条jquery效果

时间:2014-11-25 10:32:14      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:io   ar   os   sp   for   on   cti   bs   html   

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);

 

进度条jquery效果

标签:io   ar   os   sp   for   on   cti   bs   html   

原文地址:http://www.cnblogs.com/dingyuanxin/p/4120285.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!