-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (41 loc) · 1.68 KB
/
index.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
// function openOption(evt, options) {
// // Declare all variables
// var i, tabcontent, tablinks;
// // Get all elements with class="tabcontent" and hide them
// tabcontent = document.getElementsByClassName("tabcontent");
// for (i = 0; i < tabcontent.length; i++) {
// tabcontent[i].style.display = "slide";
// }
// // Get all elements with class="tablinks" and remove the class "active"
// tablinks = document.getElementsByClassName("tablinks");
// 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 button that opened the tab
// document.getElementById(options).style.display = "block";
// evt.currentTarget.className += " active";
// }
// Initialize and add the map
// function initMap() {
// // The location of Uluru
// const park = { lat: -25.344, lng: 131.036 };
// // The map, centered at Uluru
// const map = new google.maps.Map(document.getElementById("map"), {
// zoom: 4,
// center: park,
// });
// // The marker, positioned at Uluru
// const marker = new google.maps.Marker({
// position: park,
// map: map,
// });
// }
var header = document.getElementById("myDIV");
var btns = header.getElementsByClassName("tablinks");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace("active", "");
this.className += "active";
});
}