$(function(){ //动画 wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, mobile: false, live: true }) wow.init(); }); ;(function($,window,document){"use strict";var defaults={deval:0,classname:'datanums',digit:''};function rollnum(obj,options){this.obj=obj;this.options=$.extend(defaults,options);this.init=function(){this.inithtml(obj,defaults);}} rollnum.prototype={inithtml:function(obj,options){var strhtml='
';obj.html(strhtml);} this.scronum(obj,options);},scronum:function(obj,options){var number=options.deval;var $num_item=$(obj).find('.'+options.classname).find('.tt');var h=$(obj).find('.databoc').height();$num_item.css('transition','all 2s ease-in-out');var numberstr=number.tostring();if(numberstr.length<=$num_item.length-1){var tempstr='';for(var a=0;a<$num_item.length-numberstr.length;a++){tempstr+='0';} numberstr=tempstr+numberstr;} var numberarr=numberstr.split('');$num_item.each(function(i,item){settimeout(function(){$num_item.eq(i).css('top',-parseint(numberarr[i])*h-h*10+'px');},i*100)});}} $.fn.rollnum=function(options){var $that=this;var rollnumobj=new rollnum($that,options);rollnumobj.init();};})(jquery,window,document);