Skip to content

A simple stopwatch by plain JavaScript. 一个简单的纯js实现的秒表

License

Notifications You must be signed in to change notification settings

yangxin1994/stopwatch.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

stopwatch.js

A simple stopwatch by plain JavaScript. 一个简单的纯js实现的秒表
效果如下:
00 : 02 : 34 : 40

How to use it?

// initialization 初始化
var sw = new stopwatch({
    el: '#container', // element,  default value is '.stopwatch'.
    startTime: 0, // start time by Second, default value is 0.
    displayTpl: '{hour} : {minute} : {second} : {millisecond}' // display template
});

// pause 暂停
sw.pause();

// start 继续
sw.start();

// reset 重设
sw.reset();


Live Demo

STOPWATCH

License

simplepen is available under the terms of the MIT License.

About

A simple stopwatch by plain JavaScript. 一个简单的纯js实现的秒表

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 65.6%
  • HTML 34.4%