jQuery+CSS3数字滚动统计代码
经常在别人网站上看到数字滚动的炫酷的代码,今天在站长素材找到了一款,自己去除了样式,改了下。
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>jQuery+CSS3数字滚动统计代码</title> <!--必要样式--> <link href="css/bootstrap.min.css" rel="stylesheet"> <style type="text/css"> span{ font-size: 24px; } </style> </head> <body> <div> <div> <div> <p>让业主放心的互联网装修招标服务平台</p> </div> <div class="col-xs-4 col-sm-4"> <p>入住企业</p> <p><span>1250</span>家</p> </div> <div class="col-xs-4 col-sm-4"> <p>注册用户</p> <p><span>1250</span>人</p> </div> <div class="col-xs-4 col-sm-4"> <p>交易金额</p> <p><span>1250</span>元</p> </div> </div> </div> <script src="js/jquery-1.11.0.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('.counter-value').each(function(){ $(this).prop('Counter',0).animate({ Counter: $(this).text() },{ duration: 2000, easing: 'swing', step: function (now){ $(this).text(Math.ceil(now)); } }); }); }); </script> </body> </html>
发表评论: