Timeswidgets

This widgets is based on jQuery Countdown Plugin from Martin Angelov. It requires metro-countdown.js.

Countdown

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
  1. <div class="countdown" data-role="countdown" data-blink="false" style="font-size: 20px"></div>
  2. <div class="countdown inverse" data-role="countdown"></div>
  3. <div class="countdown" data-role="countdown" data-style-background="bg-lightBlue"></div>
  4. <div class="countdown" data-role="countdown" data-style-background="bg-teal" data-style-foreground="fg-yellow"></div>
  5. <div class="countdown" data-role="countdown" data-style-divider="fg-red"></div>

You can activate widget manually or auto with data-* api.

Activate widget with Javascript

  1. $("#componennt_id").countdown({
  2. style: {
  3. background: string, //existing class for digit background color
  4. foreground: string //existing class for digit foreground color
  5. divider: string //existing class for divider foreground color
  6. },
  7. blink: true, // blink divider
  8. days: int, // days to alert, set stoptimer to zero, default 1
  9. stoptimer: string, // the string value of datetime, example '2013-07-05 12:00'
  10. ontick: function(d, h, m, s){...},
  11. onstop: function(){...}
  12. });

Activate widget with API

  1. <div class="countdown" data-role="countdown" data-stoptimer="2013-07-05 12:00"></div>

Events

  1. $("#componennt_id").countdown().bind('countdownalarm', function(){...});

Times

0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

This widget require metro-times.js.

Definition

  1. <div class="times" data-role="times"></div>

You can activate widget manually or auto with data-* api.

Activate widget with Javascript

  1. $("#componennt_id").times({
  2. style: {
  3. background: string, //existing class for digit background color
  4. foreground: string //existing class for digit foreground color
  5. divider: string //existing class for divider foreground color
  6. },
  7. blink: true, // blink divider
  8. alarm: {h:..., m:..., s:...},
  9. ontick: function(h, m, s){...},
  10. onalarm: function(){...},
  11. });

Activate widget with API

  1. <div class="times" data-role="times" data-alarm="hh:mm:ss"></div>

Events

  1. $("#componennt_id").times().bind('timesalarm', function(){...});