Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minor fix

  • Loading branch information...
commit 266e39b660552f93352dd9c25de5bf3f0d463177 1 parent a71ec61
@jonasanx authored
Showing with 13 additions and 12 deletions.
  1. +13 −12 jquery.scountdown.js
View
25 jquery.scountdown.js
@@ -3,26 +3,27 @@
* https://github.com/jonasanx/jQuery-simple-countdown
* @author Jonathan J. Flores
*/
-;(function ($) {
+ ;(function ($) {
$.scountdown = function (element, options) {
var plugin = this;
var time = {
- days : 24*60*60,
- hours : 60*60,
- minutes: 60 };
+ days: 24 * 60 * 60,
+ hours: 60 * 60,
+ minutes: 60
+ };
plugin.init = function () {
var settings = $.extend({}, {
- timestamp : 0,
- callback : function(){}
+ timestamp: 0,
+ callback: function () {}
}, options);
- (function countdown(){
+ (function countdown() {
var timeLeft = Math.floor((settings.timestamp - (new Date())) / 1000);
var digits = {}
- if(timeLeft < 0) timeLeft = 0;
+ if (timeLeft < 0) timeLeft = 0;
for (key in time) {
var y = time[key];
@@ -41,11 +42,11 @@
// Private methods
var add_leading_zero = function (n) {
- return (n.toString().length < 2) ? '0' + n : n;
- }
+ return (n.toString().length < 2) ? '0' + n : n;
+ }
- // Fire!
- plugin.init();
+ // Fire!
+ plugin.init();
}
$.fn.scountdown = function (options) {
Please sign in to comment.
Something went wrong with that request. Please try again.