jquery计时器

来源:互联网 发布:c语言购物卡制卡系统 编辑:程序博客网 时间:2024/06/07 03:12

jquery计时器 函数
给class=”ball”的div内容增添滚动数字效果

function ball(i,value){ var count=0;  var time=5000/value;  var ballid=$('.ball').eq(i);  timer=setInterval(function(){   if(count<value){  count++;  ballid.html(count);}  else  {      clearInterval(timer);  }}  ,time)}
0 0