-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a777214
commit 28ec21e
Showing
3 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
var x = 1; | ||
var clickCount = 0; | ||
|
||
function initmethod() { | ||
function ClickMeFunc() { | ||
clickCount++; | ||
document.getElementById("clickme").innerHTML = "Click Me " + clickCount; | ||
if (clickCount == 1) { | ||
document.getElementById("clickme").innerHTML = "Clicked once";; | ||
} else { | ||
if (clickCount == 2) { | ||
document.getElementById("clickme").innerHTML = "Clicked twice"; | ||
} | ||
} | ||
if (clickCount > 2) { | ||
document.getElementById("clickme").innerHTML = "Clicked " + clickCount+ " times"; | ||
} | ||
|
||
if (x < 9) { | ||
x+=1; | ||
console.log("X is zero"); | ||
document.getElementById("title").innerHTML = "Kat Level: "+(x+1); | ||
document.getElementById("title").style.marginLeft = ((x+1)*20) + "px"; | ||
} else { | ||
x = 0; | ||
} | ||
console.log("X is zero"); | ||
document.getElementById("title").innerHTML = "Kat Level: "+(clickCount+1); | ||
document.getElementById("title").style.marginLeft = ((x+1)*20) + "px"; | ||
|
||
document.getElementById("clickme").style.marginLeft = ((x+1)*20) + "px"; | ||
document.getElementById("progbar").innerHTML = "Progress: " + (clickCount) + "%"; | ||
document.getElementById("progbar").style.width = (clickCount) + "%"; | ||
if (clickCount == 9) { | ||
winner(); | ||
} | ||
} | ||
|
||
|
||
function winner() { | ||
alert("Winner"); | ||
} | ||
|
||
//#initmethod(); |