-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aliasger Rasheed
committed
Oct 31, 2019
1 parent
d3c63cc
commit 15cb7cf
Showing
4 changed files
with
195 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// https://www.w3schools.com/howto/howto_js_tabs.asp | ||
function switchTab(evt, groupName) { | ||
console.log("function hit"+groupName); | ||
|
||
var i, tabcontent, tablinks; | ||
|
||
// Get all elements with class="tabcontent" and hide them | ||
tabcontent = document.getElementsByClassName("tab-content"); | ||
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("group-tab"); | ||
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(groupName).style.display = "block"; | ||
evt.currentTarget.className += " active"; | ||
} |
Empty file.