forked from TextureGroup/Texture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle.js
More file actions
executable file
·27 lines (25 loc) · 1 KB
/
Copy pathtoggle.js
File metadata and controls
executable file
·27 lines (25 loc) · 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
document.addEventListener("DOMContentLoaded", function() {
var swiftButtons = document.getElementsByClassName("swiftButton");
var objectiveCButons = document.getElementsByClassName("objcButton");
var objcCodes = document.getElementsByClassName("objcCode");
var swiftCodes = document.getElementsByClassName("swiftCode");
var totalCodeSections = swiftButtons.length;
for(var i = 0; i < totalCodeSections; i++) {
swiftButtons[i].onclick = function () {
for (var i = 0; i < totalCodeSections; i++) {
swiftCodes[i].classList.remove("hidden");
objcCodes[i].classList.add("hidden");
objectiveCButons[i].classList.remove("active");
swiftButtons[i].classList.add("active");
};
}
objectiveCButons[i].onclick = function () {
for (var i = 0; i < totalCodeSections; i++) {
swiftCodes[i].classList.add("hidden");
objcCodes[i].classList.remove("hidden");
objectiveCButons[i].classList.add("active");
swiftButtons[i].classList.remove("active");
};
}
}
});