counter.js 975 B

12345678910111213141516171819202122232425262728293031323334
  1. $(function() {
  2. // default setup
  3. $('#timer-countdown').countdown({
  4. from: 180, // 3 minutes (3*60)
  5. to: 0, // stop at zero
  6. movingUnit: 1000, // 1000 for 1 second increment/decrements
  7. timerEnd: undefined,
  8. outputPattern: '$day Day $hour : $minute : $second',
  9. autostart: true
  10. });
  11. // count up
  12. $('#timer-countup').countdown({
  13. from: 0,
  14. to: 180
  15. });
  16. // count in-between
  17. $('#timer-countinbetween').countdown({
  18. from: 60,
  19. to: 20
  20. });
  21. // counter callback
  22. $('#timer-countercallback').countdown({
  23. from: 1440,
  24. to: 0,
  25. timerEnd: function() {
  26. this.animate({ 'opacity': .5 }, 500).css({ 'text-decoration': 'line-through' });
  27. }
  28. });
  29. // changed output patterns
  30. $('#timer-outputpattern').countdown({
  31. outputPattern: '$day Days $hour Hours $minute Minutes $second Seconds',
  32. from: 60 * 60 * 24 * 3
  33. });
  34. });