ringa_lee2017-04-18 10:01:121楼
function getdata(){
var num = $("#cur_num").val();
$.ajax({
url: 'updateCountWx.action',
type: 'POST',
dataType: "json",
data:{'total':num},
cache: false,
timeout: 10000,
error: function(){},
success: function(data){
show_num(JSON.parse(data).counttest);
}
});
}
function show_num(n){
var it = $(".t_num i");
var len = String(n).length;
for(var i=0;i
if(it.length<=i){
$(".t_num").append("");
}
var num=String(n).charAt(i);
var y = -parseInt(num)*30;
var obj = $(".t_num i").eq(i);
obj.animate({
backgroundPosition :'(0 '+String(y)+'px)'
}, 'slow','swing',function(){}
);
}
$("#cur_num").val(n);
}