lyunm1206
commited on
Commit
·
37d7d44
1
Parent(s):
b444d83
dre
Browse files- index.html +1 -1
- script.js +2 -0
index.html
CHANGED
|
@@ -46,7 +46,7 @@
|
|
| 46 |
/* Style for the tab buttons */
|
| 47 |
.tabs {
|
| 48 |
text-align: center;
|
| 49 |
-
margin-
|
| 50 |
}
|
| 51 |
|
| 52 |
.tab-button {
|
|
|
|
| 46 |
/* Style for the tab buttons */
|
| 47 |
.tabs {
|
| 48 |
text-align: center;
|
| 49 |
+
margin-top: 20px;
|
| 50 |
}
|
| 51 |
|
| 52 |
.tab-button {
|
script.js
CHANGED
|
@@ -105,6 +105,8 @@ function openTab(tabId) {
|
|
| 105 |
for (i = 0; i < tabcontent.length; i++) {
|
| 106 |
tabcontent[i].style.display = "none";
|
| 107 |
}
|
|
|
|
|
|
|
| 108 |
var selectedTabContent = document.getElementById(tabId);
|
| 109 |
if (selectedTabContent) {
|
| 110 |
selectedTabContent.style.display = "block";
|
|
|
|
| 105 |
for (i = 0; i < tabcontent.length; i++) {
|
| 106 |
tabcontent[i].style.display = "none";
|
| 107 |
}
|
| 108 |
+
tabButtons.forEach(button => button.classList.remove('active'));
|
| 109 |
+
document.querySelector(`[data-tab='${tabId}']`).classList.add('active');
|
| 110 |
var selectedTabContent = document.getElementById(tabId);
|
| 111 |
if (selectedTabContent) {
|
| 112 |
selectedTabContent.style.display = "block";
|