dataScoll.js 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // 数字滚动
  2. function numInit() {
  3. $('.counter-value').each(function(){
  4. $(this).prop('Counter',0).animate({
  5. Counter: $(this).text()
  6. },{
  7. duration: 2500,
  8. easing: 'swing',
  9. step: function (now){
  10. $(this).text(now.toFixed(0));
  11. }
  12. });
  13. });
  14. }
  15. function numInit1() {
  16. $('.counter-value1').each(function(){
  17. $(this).prop('Counter',0).animate({
  18. Counter: $(this).text()
  19. },{
  20. duration: 2500,
  21. easing: 'swing',
  22. step: function (now){
  23. $(this).text(now.toFixed(1));
  24. }
  25. });
  26. });
  27. }
  28. function numInit2() {
  29. $('.counter-value2').each(function(){
  30. $(this).prop('Counter',0).animate({
  31. Counter: $(this).text()
  32. },{
  33. duration: 2500,
  34. easing: 'swing',
  35. step: function (now){
  36. $(this).text(now.toFixed(2));
  37. }
  38. });
  39. });
  40. }
  41. numInit();
  42. numInit1();
  43. numInit2();