-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabs.html
78 lines (72 loc) · 1.99 KB
/
tabs.html
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Style the tab */
.tabNav {
overflow: hidden;
background-color: #f1f1f1;
width: 100vw;
}
body {
margin: 0px;
}
/* Style the buttons inside the tab */
.tabNav button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
font-size: 17px;
}
/* Change background color of buttons on hover */
.tabNav button:hover {
background-color: #ddd;
}
/* Create an active/current tablink class */
.tabNav button.active {
background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border: none;
border-top: none;
}
</style>
</head>
<body onload='loadTools()'>
<div class="tabNav">
<button class="tablinks" onclick="openToolTab(event, 'renTools')">Rentals</button>
<button class="tablinks" onclick="openToolTab(event, 'avail')">Avail.</button>
<button class="tablinks" onclick="openToolTab(event, 'rezTools')">Rez Form</button>
</div>
<div id="renTools" class="tabcontent">
</div>
<div id="avail" class="tabcontent">
<h3>Availability</h3>
</div>
<div id="rezTools" class="tabcontent">
</div>
</body>
<script>
function openToolTab(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>
</html>