Created
July 9, 2014 23:35
-
-
Save gpedote/671aded8d03d396801fe to your computer and use it in GitHub Desktop.
Brazil x Germany, source: www.brasilalemanhaeterno.com
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
$(document).ready(function() { | |
var gameStartDiff = Math.abs(new Date() - new Date('2014/07/08 17:00:00')); | |
var minuteInMileseconds = 60 * 1000; | |
var update = function () { | |
var brazilGoals = Math.round(gameStartDiff / (90 * minuteInMileseconds)); | |
var germanGoals = Math.round(gameStartDiff / (12 * minuteInMileseconds)); | |
$('#brazil-goals').html(brazilGoals); | |
$('#german-goals').html(germanGoals); | |
} | |
setTimeout(function(){ update(); }, 60000); | |
update(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment