25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.3 KiB

3 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Counter-Up
  2. ==========
  3. Counter-Up is a jQuery plugin that *animates* a number from zero (counting up towards it). It supports counting up:
  4. * integers `12345`
  5. * floats `0.1234`
  6. * formatted numbers `1,234,567.00`
  7. Features:
  8. * Auto-detect for integers, floats or formatted numbers
  9. * The plugin will also use the number of decimal places the original number is using.
  10. * Lightweight: ~1kb
  11. * Minimal setup
  12. *Requires [waypoints.js](http://imakewebthings.com/jquery-waypoints/)*
  13. Demo
  14. ====
  15. **[DEMO](http://bfintal.github.io/Counter-Up/demo/demo.html)**
  16. Usage
  17. =====
  18. **Include**
  19. ```
  20. <script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
  21. <script src="jquery.counterup.min.js"></script>
  22. ```
  23. **HTML**
  24. ```
  25. <span class="counter">1,234,567.00</span>
  26. <span>$</span><span class="counter">1.99</span>
  27. <span class="counter">12345</span>
  28. ```
  29. **jQuery**
  30. ```
  31. $('.counter').counterUp();
  32. ```
  33. **or with extra parameters**
  34. ```
  35. $('.counter').counterUp({
  36. delay: 10,
  37. time: 1000
  38. });
  39. ```
  40. `delay` - The delay in milliseconds per number count up
  41. `time` - The total duration of the count up animation
  42. Social Stuff
  43. ============
  44. Twitter: [@bfintal](https://twitter.com/bfintal) & [@gambitph](https://twitter.com/gambitph)
  45. Google+: <a href='https://plus.google.com/113101541449927918834' rel='author'>+Benjamin Intal</a>