timers.js

Pure JavaScript timer plugin


Keywords
javascript, timer
License
ISC
Install
npm install timers.js@1.1.10

Documentation

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