Last active
November 29, 2023 11:40
-
-
Save Jiert/bbddb482c28f6c79cccc to your computer and use it in GitHub Desktop.
Revisions
-
Jiert renamed this gist
Jan 7, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Jiert revised this gist
Jan 6, 2015 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,14 +2,13 @@ <html lang="en"> <head> <title>Tabs</title> <style> .nav .active a { color: red; } .tab-pane { display: none; } .tab-pane.active { display: block; } </style> </head> <body> <div> -
Jiert renamed this gist
Dec 11, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Jiert created this gist
Nov 19, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,57 @@ <!DOCTYPE html> <html lang="en"> <head> <title>Tabs</title> <style> .nav .active a { color: red; } .tab-pane { display: none; } .tab-pane.active { display: block; } </style> </head> <body> <div> <!-- Tabs --> <ul id="nav-tab" class="nav"> <li class="active"><a href="#home">Home</a></li> <li><a href="#profile">Profile</a></li> <li><a href="#messages">Messages</a></li> <li><a href="#settings">Settings</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane active" id="home">Home Panel</div> <div class="tab-pane" id="profile">Profile Panel</div> <div class="tab-pane" id="messages">Messages Panel</div> <div class="tab-pane" id="settings">Settings Panel</div> </div> </div> <footer> <script type="text/javascript"> (function(){ function onTabClick(event){ var actives = document.querySelectorAll('.active'); // deactivate existing active tab and panel for (var i=0; i < actives.length; i++){ actives[i].className = actives[i].className.replace('active', ''); } // activate new tab and panel event.target.parentElement.className += ' active'; document.getElementById(event.target.href.split('#')[1]).className += ' active'; } var el = document.getElementById('nav-tab'); el.addEventListener('click', onTabClick, false); })(); </script> </footer> </body> </html>