Created
November 7, 2012 01:59
-
-
Save lehrblogger/4029114 to your computer and use it in GitHub Desktop.
NYT Election Coverage for the Impatient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//In the Javascript console on http://elections.nytimes.com/2012/results/president, paste the following: | |
NYTD.NYTINT.Bigboard.Bigboard.prototype.render_timer = function() { | |
// Do nothing if the board isn't live. | |
if (!this.is_live()) { | |
return false; | |
} | |
// If we've counted to zero, re-load the data. | |
// Otherwise, decrement the counter. | |
if (this.interval <= 0) { | |
this.fetch(); | |
} else { | |
this.interval = this.interval - 5; // or however quickly you want to count down from 30 seconds | |
} | |
// Compute the time-remaining string | |
var minutes = Math.floor(this.interval / 60); | |
var seconds = this.interval % 60; | |
if (seconds < 10) { | |
seconds = '0' + seconds; | |
} | |
$(".countdown-timer").show().html(minutes + ':' + seconds); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment