Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnschult/jquery.countdown360
This is a simple attractive circular countdown timer that counts down a number of seconds. The style is configurable and a callback is supported on completion.
https://github.com/johnschult/jquery.countdown360
Last synced: 1 day ago
JSON representation
This is a simple attractive circular countdown timer that counts down a number of seconds. The style is configurable and a callback is supported on completion.
- Host: GitHub
- URL: https://github.com/johnschult/jquery.countdown360
- Owner: johnschult
- Created: 2014-05-15T13:52:31.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-14T22:53:23.000Z (about 3 years ago)
- Last Synced: 2024-11-09T04:30:32.210Z (9 days ago)
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 62
- Watchers: 10
- Forks: 51
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# jQuery countdown360
[![Build Status](https://travis-ci.org/johnschult/jquery.countdown360.svg)](https://travis-ci.org/johnschult/jquery.countdown360)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/johnschult/jquery.countdown360?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)### A simple countdown timer in seconds
This plugin provides a simple circular countdown timer with customizable settings.
[Check out a Demo](http://jsfiddle.net/johnschult/gs3WY/)
## Basic Usage
1. Include jQuery:
```html
```2. Include plugin's code:
```html
```3. Include the plugin container in your HTML:
```html
```3. Call the plugin:
```javascript
$("#countdown").countdown360({
radius : 60.5,
seconds : 5,
strokeWidth : 15,
fillStyle : '#0276FD',
strokeStyle : '#003F87',
fontSize : 50,
fontColor : '#FFFFFF',
autostart: false,
onComplete : function () { console.log('completed') }
}).start()
```## Default Options
```javascript
{
radius: 15.5, // radius of arc
strokeStyle: "#477050", // the color of the stroke
strokeWidth: undefined, // the stroke width, dynamically calulated if omitted in options
fillStyle: "#8ac575", // the fill color
fontColor: "#477050", // the font color
fontFamily: "sans-serif", // the font family
fontSize: undefined, // the font size, dynamically calulated if omitted in options
fontWeight: 700, // the font weight
autostart: true, // start the countdown automatically
seconds: 10, // the number of seconds to count down
label: ["second", "seconds"], // the label to use or false if none, first is singular form, second is plural
startOverAfterAdding: true, // Start the timer over after time is added with addSeconds
smooth: false, // update the ticks every 16ms when true
clockwise: false, // direction of rotation of the timer
onComplete: function () {}
}
```## Functions
```
.start() // starts the countdown timer
.stop() // stops the countdown timer, onComplete is not called
.extendTimer(secs) // extends the current timer by backing up by the number of seconds provided
.addSeconds(secs) // adds additional seconds to the original timer and restarts if startOverAfterAdding is true
```## Callbacks
```
onComplete // The function defined in this option is called after the timer completes.
```## Contributing
[See Contributing](https://github.com/johnschult/jquery.countdown360/blob/master/CONTRIBUTING.md)
## License
[MIT License](http://johnschult.mit-license.org/) © John Schult