-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
5 changed files
with
160 additions
and
13 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,39 @@ | ||
/* Style the tab */ | ||
.tab-nav { | ||
overflow: hidden; | ||
border: 1px solid #ccc; | ||
background-color: var(--subnav-background-color); | ||
padding: 0.5em; | ||
border-top: 1px solid var(--subnav-background-color); | ||
border-left: 1px solid var(--subnav-background-color); | ||
border-right: 1px solid var(--subnav-background-color); | ||
} | ||
|
||
/* Style the buttons inside the tab */ | ||
.tab-nav button { | ||
background-color: inherit; | ||
float: left; | ||
border: none; | ||
outline: none; | ||
cursor: pointer; | ||
padding: 0.25em 0.25em; | ||
margin-right: 1em; | ||
} | ||
|
||
/* Create an active/current tablink class */ | ||
.tab-nav button.selected { | ||
background-color: var(--selected-background-color); | ||
} | ||
|
||
/* Style the tab content */ | ||
.tab-content { | ||
display: none; | ||
padding: 0.2em; | ||
border: 1px solid var(--subnav-background-color); | ||
border-top: none; | ||
} | ||
|
||
/* Special case: PRE without enclosing DIV */ | ||
pre.tab-content { | ||
margin-top: 0; | ||
} |
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,24 @@ | ||
function openTab(evt) { | ||
let group = evt.currentTarget.parentNode.dataset.tabGroup; | ||
let name = evt.currentTarget.dataset.tabName; | ||
|
||
let tabLinks = document.querySelectorAll | ||
('.tab-nav[data-tab-group="' + group + '"] button'); | ||
for (let link of tabLinks) { | ||
if (link.dataset.tabName == name) { | ||
link.className="selected"; | ||
} else { | ||
link.className=""; | ||
} | ||
} | ||
|
||
var tabContents= document.querySelectorAll | ||
('.tab-content[data-tab-group="' + group + '"]'); | ||
for (let content of tabContents) { | ||
if (content.dataset.tabName == name) { | ||
content.style.display="block"; | ||
} else { | ||
content.style.display="none"; | ||
} | ||
} | ||
} |
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