-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript-beta.js
More file actions
39 lines (36 loc) · 1.1 KB
/
javascript-beta.js
File metadata and controls
39 lines (36 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$(document).ready(function() {
var startHash = window.location.search; // the text after the ? in the path
if (startHash) {
$(".opinion").click(function() {
if ($(this).hasClass("faded")) {
$(this).removeClass("faded");
if (this.id == 'hard') {
$("#easy").addClass("faded");
} else {
if (this.id == 'easy') {
$("#hard").addClass("faded");
}
}
} else {
$(this).addClass("faded");
}
});
$(".result-button").click(function() {
if ($(this).hasClass("clicked-result-button")) {
$(".result-button").removeClass("clicked-result-button");
$("#results-form").find("input[type=radio]").prop('checked', false);
} else {
$(".result-button").removeClass("clicked-result-button");
$("#results-form").find("input[type=radio]").prop('checked', false);
$(this).addClass("clicked-result-button");
if (this.id == 'attempt-button') {
$("#attempt1").prop('checked', true);
}
}
});
$(".radio").click(function() {
$(".result-button").removeClass("clicked-result-button");
$("#attempt-button").addClass("clicked-result-button");
});
}
} );