Giter Site home page Giter Site logo

jq-timeto's Introduction

TimeTo

jQuery plugin - timer countdown digital clock

Demo

http://lexxus.github.io/jq-timeTo/

Examples

Countdown timer

Set delay in seconds

$('#countdown').timeTo(100, function(){ alert('Countdown finished'); });

Hide hours

$('#countdown').timeTo({ seconds: 100, displayHours: false });

Set delay to specyfied datetime

$('#countdown').timeTo(new Date('Dec 10 2013 00:00:00 GMT+0200 (EET)'));

Set captions and dark theme

$('#countdown').timeTo({
    timeTo: new Date(new Date('Dec 10 2013 00:00:00 GMT+0200 (EET)')),
    theme: "black",
    displayCaptions: true
});

Digital clock

$('#clock-1').timeTo();

Usage

$(<selection>).timeTo([options]);

Whithout options it makes simple digital clock with current system time.

where options can be...

Object

Object with initial settings:

  • callback: function that call when countdown end, default null;
  • captionSize: integer font-size by pixels for captions, if 0 then calculate automaticaly, default 0;
  • countdown: boolean if false then it's as clock, default true;
  • countdownAlertLimit: integer seconds left to countdown end after that clock apply CSS class timeTo-alert, default 10;
  • displayDays: integer count of digits days to display, default auto (for backward compatibility true means 3);
  • displayCaption: boolean if true then captions display, default false;
  • displayHours: boolean if false then hide hours, default true;
  • fontFamily: string font-family for digits, default 'Verdana, sans-serif';
  • fontSize: integer font-size by pixels for digits, default 28;
  • lang: string language for caption, available 'en', 'ru', 'ua', 'de', 'fr', 'sp', 'it', 'nl', 'no', 'pt', default 'en';
  • seconds: integer initial time in seconds for countdown timer, default 0;
  • start: boolean if true - start timer automaticaly, else need execute .timeTo("start"), default true;
  • theme: string nameof color theme, available "white" and "black", default 'white';
  • timeTo: date object specify date and time for current time or for countdown to, default null.

Integer

Initial setting for seconds option

$('#clock').timeTo(100)
// is identical to
$('#clock').timeTo({
    seconds: 100
});

Date object

Initial setting for timeTo option

$('#clock').timeTo(new Date('Dec 10 2013 00:00:00'));
// is identical to
$('#clock').timeTo({
    timeTo: new Date('Dec 10 2013 00:00:00')
});

String

Action for execute. Available: 'start', 'stop', 'reset'.

jq-timeto's People

Contributors

lexxus avatar atorrestatis avatar isochronous avatar lucablackdragon avatar christophborndigital avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.