<div class="minge"> <p>仅剩 <span>126</span>个名额</p> </div>
数据增加的js:
<script type="text/javascript"> $(function(){ numPlus($(".minge span"),3000) }) var numPlus = function(obj,time){ setInterval(function(){ if($(obj).html()==0){ return; } $(obj).html(parseInt($(obj).html())+1) },time) } </script>