Add Another Vanilla JavaScript Tabbed Content With Equal Height | sv-tabs-js

sv-tabs-js is a JavaScript library of small tabs that helps create tabbed content with equal height support and it automatically adjusts the height of the tabs component based on the longest tabbed content.

It also provides a function to automatically update the hashtag in the URL, which means that users are able to open specific classified content by URL.

How to make use of it:

1. Insert the sv-tabs-js’ JavaScript and CSS files into the doc.

<link rel="stylesheet" href="sv-tabs.css" />
<script src="sv-tabs.js"></script>

2. The required HTML structure for the tabs & tabbed content.

<div class="sv-tabs-wrapper">
  <nav class="sv-tabs-tab-list">
    <a class="sv-tabs-tab active" href="#tab1">Tab 1</a>
    <a class="sv-tabs-tab" href="#tab2">Tab 2: Tab Harder</a>
    <a class="sv-tabs-tab" href="#tab3">3</a>
  <div class="sv-tabs-panel-list">
    <div class="sv-tabs-panel" id="tab2">
      I'll be whatever I wanna do.
    <div class="sv-tabs-panel" id="tab3">
      Interesting. No, wait, the other thing: tedious. Shut up and take my money! OK, if everyone's finished being stupid. And I'd do it again! And perhaps a third time! But that would be it. Throw her in the brig. I'm just glad my fat, ugly mama isn't alive to see this day. File not found. Ah, the 'Breakfast Club' soundtrack! I can't wait til I'm old enough to feel ways about stuff.
    <div class="sv-tabs-panel active" id="tab1">
      You may have to metaphorically make a deal with the devil. And by "devil", I mean Robot Devil. And by "metaphorically", I mean get your coat.

3. Initialize the tabs element.

var tabWrapper = document.querySelector('.sv-tabs-wrapper');
var svTabs = new SV.Tabs(tabWrapper);

4. Determine whether or not they equalize the height of the tabbed content material.

var svTabs = new SV.Tabs(tabWrapper,{
    equalHeight: true

5. Determine whether or not so as to add anchor links to tabs.

var svTabs = new SV.Tabs(tabWrapper,{
    useAnchors: true

6. Override the default variables to create your individual types.

// Compile with `sass sv-tabs.scss:sv-tabs.css --no-source-map`
$spacing-unit: 16px !default;
$base-border: 1px solid #ccc !default;
$bd-rad: 4px !default;

$tab-bg-on: #fff !default;
$tab-bg-off: #eee !default;
$tab-bg-hover: #ddd !default;

$tab-text-on: #666 !default;
$tab-text-off: #666 !default;

Tabbed Content With Equal Height Support, sv-tabs-js Plugin/Github

See Demo And Download

Official Website(svivian): Click Here

This superior jQuery/javascript plugin is developed by svivian. For extra advanced usage, please go to the official website.

Related Posts


Create Side Sliders Input Values Using Mouse Drag | Pointer Lock

HTML Range Slider is a lightweight library to create side sliders to adjust values easily and precisely by making use of the Pointer Lock API. Side Slider…


Smooth and Lightweight Parallax Scroll Library in Pure Javascript

Lightweight and seamless parallax scrolling library implemented in pure javascript using hardware acceleration for additional performance. Main Features Extremely lightweight with no dependencies A few kilobytes of pure…


How to Convert Form Data to JSON with HTML Forms | FormsJS

FormsJS is a simple-to-use JavaScript library that covers type subject values to JSON in real time. The items containing the data category will be analyzed automatically. It…


A Small jQuery Extension to Convert An Editable HTML Table

Editable Table is a small jQuery extension to convert an editable HTML table for fast data entry and validation. A small jQuery extension to convert a static…

Simple jQuery Plugin for Embedding YouTube Videos As Cover Background is a jQuery plugin built to facilitate YouTube embeds as cover wallpaper using the YouTube Embed API. There is another jQuery Youtube Video Background plugin that…


Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…