Coder Social home page Coder Social logo

freddesign / jquery.countdown360 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnschult/jquery.countdown360

0.0 3.0 0.0 273 KB

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.

JavaScript 91.28% HTML 8.72%

jquery.countdown360's Introduction

jQuery countdown360

Build Status Gitter

A simple countdown timer in seconds

This plugin provides a simple circular countdown timer with customizable settings.

Check out a Demo

Basic Usage

  1. Include jQuery:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
  2. Include plugin's code:

    <script src="dist/jquery.countdown360.min.js"></script>
  3. Include the plugin container in your HTML:

<div id="countdown"></div>
  1. Call the plugin:
$("#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

{
  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
	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

License

MIT License © John Schult

jquery.countdown360's People

Contributors

johnschult avatar ejames17 avatar

Watchers

 avatar 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.