-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuttons.js
More file actions
49 lines (43 loc) · 1.7 KB
/
Copy pathbuttons.js
File metadata and controls
49 lines (43 loc) · 1.7 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
39
40
41
42
43
44
45
46
47
48
49
// Click functionality of level select blocks
$(function() {
$("#beginner").on("click",function(e) {
$("#beginner_content").css("display", "block");
$("#intermediate_content").css("display", "none");
$("#advanced_content").css("display", "none");
});
});
$(function() {
$("#intermediate").on("click",function(e) {
$("#beginner_content").css("display", "none");
$("#intermediate_content").css("display", "block");
$("#advanced_content").css("display", "none");
});
});
$(function() {
$("#advanced").on("click",function(e) {
$("#beginner_content").css("display", "none");
$("#intermediate_content").css("display", "none");
$("#advanced_content").css("display", "block");
});
});
// Click functionality of reference system select blocks
$(function() {
$(".reference_system").on("click",function(e) {
var content_string = $(this).text().trim();
var content_list = $(this).parent().siblings(".reference_system_contents").children();
for (let i = 0; i < content_list.length; i++) {
if (content_list.eq(i).attr('id') === content_string) {
content_list.eq(i).css("display", "inline"); // show selected content
for (let j = 0; j < content_list.length; j++) {
if (i != j) {
content_list.eq(j).css("display", "none"); // hide other content
}
}
}
}
$(this).css("background-color", "darkviolet");
$(this).css("color", "white");
$(this).siblings().css("background-color", "rgb(246, 237, 253)");
$(this).siblings().css("color", "black");
});
});