Skip to content

Instantly share code, notes, and snippets.

@mrshu
Forked from Adman/goals
Created February 27, 2012 17:22
Show Gist options
  • Save mrshu/1925622 to your computer and use it in GitHub Desktop.
Save mrshu/1925622 to your computer and use it in GitHub Desktop.
missing }
var goal1 = 0;
var goal2 = 0;
window.scaling1 = 0;
window.scaling2 = 0;
function toggleOnGoal() {
btnStart = document.getElementById("btnStart");
if (btnStart.innerHTML == "Pause") {
$("#time").stopwatch().stopwatch('stop');
btnStart.innerHTML = "Resume";
}
}
function team1Goal() {
if (window.scaling1 == 1) {
return false;
} else {
goal1++;
//toggleOnGoal();
$("#team1").html(goal1);
window.scaling1 = 1;
$("#team1").effect("scale", {
percent: 150
}, 1000).effect("scale", {
percent: Math.ceil(100 / (150 / 100))
}, 1000, function () {
window.scaling1 = 0;
});
}
}
function team2Goal() {
goal2++;
//toggleOnGoal();
$("#team2").html(goal2);
$("#team2").effect("scale", {
percent: 150
}, 1000).effect("scale", {
percent: Math.ceil(100 / (150 / 100))
}, 1000);
}
function team1Down() {
if (goal1 <= 0) {
goal1 = 0;
return false;
} else {
goal1--;
$("#team1").html(goal1);
$("#team1").effect("scale", {
percent: 150
}, 1000).effect("scale", {
percent: Math.ceil(100 / (150 / 100))
}, 1000);
return false;
}
}
function team2Down() {
if (goal2 <= 0) {
goal2 = 0;
return false;
} else {
goal2--;
$("#team2").html(goal2);
$("#team2").effect("scale", {
percent: 150
}, 1000).effect("scale", {
percent: Math.ceil(100 / (150 / 100))
}, 1000);
return false;
}
}
function resetScore() {
goal1 = 0;
goal2 = 0;
$('#team1').html(goal1);
$('#team2').html(goal2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment