renjithspace / timers.js

Pure JavaScript timer plugin

Home Page:https://git.io/vFUhy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timers.js

Pure JavaScript timer plugin

Installation

NPM

npm install timers.js --save

In Node.js

require('timers.js')

Direct download from latest releases

Usage

Include

<script src="dist/js/timers.js"></script>

Initialize

new Timer();

Configuration

new Timer({
    // Options here
    property: value,
    ...
});

Options

Property Description Available values Default value
el Timer.js element Element selector (string) '.timer'
time.second Set initial second integer 0
time.minute Set initial minute integer 0
time.hour Set initial hour integer 0
isStoped Set timer status boolean false

Methods

Method Description
.get('second|minute|hour') Get the current time
.set('second|minute|hour', value) Set time
.pause() Pause the timer
.stop() Stop the timer
.resume() Resume the timer

About

Pure JavaScript timer plugin

https://git.io/vFUhy


Languages

Language:JavaScript 55.4%Language:HTML 28.6%Language:CSS 16.0%