Vertical Tab Component
How do I make an vertical tab component?
What is a vertical tab component? How do you make a vertical tab component? This script and codes were developed by Christian Fleschhut on 11 August 2022, Thursday.
Vertical Tab Component - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Vertical Tab Component</title> <meta name='viewport' content='width=device-width, initial-scale=1'> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class='tabs'> <nav class='tabs__nav' role='nav'> <ul class='tabs__nav--list'> <li> <a class='tabs__nav--link' href='#tab-item-1'> Option 1 </a> </li> <li> <a class='tabs__nav--link' href='#tab-item-2'> Option 2 </a> </li> <li> <a class='tabs__nav--link' href='#tab-item-3'> Option 3 </a> </li> </ul> </nav> <article class='tabs__wrapper' role='main'> <div class='tabs__item' id='tab-item-1'> <h2> Heading 1 </h2> <p> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend. </p> <p> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend. </p> </div> <div class='tabs__item' id='tab-item-2'> <h2> Heading 2 </h2> <p> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend. </p> <p> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend. </p> </div> <div class='tabs__item' id='tab-item-3'> <h2> Heading 3 </h2> <p> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend. </p> <p> Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend. </p> </div> </article>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Vertical Tab Component - Script Codes CSS Codes
.tabs { display: table; width: 100%;
}
.tabs__nav,
.tabs__wrapper { display: table-cell; vertical-align: top;
}
.tabs__nav { width: 30%; background: #f2f2f2;
}
.tabs__nav--list { margin: 0; padding: 0; list-style: none;
}
.tabs__nav--link { display: block; margin: 0 0 1px; padding: 10px 15px; color: #999; background: #e6e6e6; text-decoration: none;
}
.tabs__nav--link:hover, .is-active .tabs__nav--link { color: #333; background: #cccccc;
}
.tabs__wrapper { width: 70%; padding: 0 20px;
}
Vertical Tab Component - Script Codes JS Codes
(function() { $.fn.tabify = function(options) { return this.each(function(i, el) { var defaults, hideAllTabs, highlightActiveLink, settings, showCurrentTab; defaults = { container: $(this), tabsItems: $(this).find('.tabs__item') }; settings = $.extend(defaults, options); showCurrentTab = function(ev) { var href, tab; ev.preventDefault(); href = $(this).attr('href'); tab = $(href); highlightActiveLink(this); hideAllTabs(); return tab.show(); }; hideAllTabs = function() { return settings.tabsItems.hide(); }; highlightActiveLink = function(link) { var listItems; link = $(link); listItems = link.parent().siblings(); listItems.removeClass('is-active'); return link.parent().addClass('is-active'); }; settings.container.on('click.tabify', '> nav a', showCurrentTab); return settings.container.find('nav a:first').trigger('click'); }); }; $(function() { return $('.tabs').tabify(); });
}).call(this);
Developer | Christian Fleschhut |
Username | cfleschhut |
Uploaded | August 11, 2022 |
Rating | 3 |
Size | 3,878 Kb |
Views | 36,432 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Givie.io Logo in CSS | 2,552 Kb |
React-Bootstrap sandbox | 2,936 Kb |
CodeSchool Powering Up with React | 7,420 Kb |
Hello Backbone.js | 3,017 Kb |
AngularJS comments form | 3,280 Kb |
Processing.js Playground | 2,392 Kb |
Json data for todolist | 1,615 Kb |
Sass random fn | 4,849 Kb |
Backbone.js Playground | 2,812 Kb |
Starting out with Ember.JS | 4,808 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Simple Carousel Pure CSS | Dangvanthanh | 4,080 Kb |
AngularJS Skills | Supro | 3,312 Kb |
A Different Type of Gallery | DonPage | 2,950 Kb |
Fullscreen audio play button | 72 | 2,148 Kb |
Yuliya v krylova | Rafszul | 37,351 Kb |
Algorithm practice | Abensur | 5,620 Kb |
A Pen by Dalton Liu | Liudalton | 12,437 Kb |
Canvas stripes | Adrianparr | 1,948 Kb |
HTML5 Video Autoplay | Zivcos | 1,352 Kb |
Long Shadow Button | Uixcrazy | 3,550 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!