-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocumentation.js
44 lines (36 loc) · 1.64 KB
/
documentation.js
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
document.querySelector("#defaultOpen").click();
document.querySelector("#defaultClass").click();
function openPage(pageName, elmnt, color) {
// Hide all elements with class="tabcontent" by default */
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Remove the background color of all tablinks/buttons
tablinks = document.getElementsByClassName("tablink");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].style.backgroundColor = "";
}
// Show the specific tab content
document.getElementById(pageName).style.display = "block";
// Add the specific color to the button used to open the tab content
elmnt.style.backgroundColor = color;
}
// function openTab(evt, cityName) {
// // Declare all variables
// var i, tabcontent, tablinks;
// // Get all elements with class="tabcontent" and hide them
// tabcontent = document.getElementsByClassName("tabcontent2");
// for (i = 0; i < tabcontent.length; i++) {
// tabcontent[i].style.display = "none";
// }
// // Get all elements with class="tablinks" and remove the class "active"
// tablinks = document.getElementsByClassName("tablinks2");
// for (i = 0; i < tablinks.length; i++) {
// tablinks[i].className = tablinks[i].className.replace(" active", "");
// }
// // Show the current tab, and add an "active" class to the link that opened the tab
// document.getElementById(cityName).style.display = "block";
// evt.currentTarget.className += " active";
// }