Simple Tabs and Quick Javascript Vanilla

Vanilla JavaScript Tabs is a simple and lightweight JS Tabs library for the web.

How to make use of it:

1. Add the JavaScript vanilla-js-tabs.js and Stylesheet vanilla-js-tabs.css to the web page.

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

2. The required HTML structure for the tabs.

<div class="js-tabs" id="tabs">
  <ul class="js-tabs__header">
    <li><a class="js-tabs__title" href="#">Tab 1</a></li>
    <li><a class="js-tabs__title" href="#">Tab 2</a></li>
    <li><a class="js-tabs__title" href="#">Tab 3</a></li>
  </ul>
  <div class="js-tabs__content">
    <h1>Tab 1</h1>
  </div>
  <div class="js-tabs__content">
    <h1>Tab 2</h1>
  </div>
  <div class="js-tabs__content">
    <h1>Tab 3</h1>
  </div>
</div>

3. Initialize the tabs plugin.

var tabs = new Tabs({
    elem: "tabs"
});

4. Determine which tab must be open on web page load.

var tabs = new Tabs({
    elem: 'tabs',
    open: 2
});

5. Open a particular tab.

tabs.open(2);

6. Update the tabs.

tabs.update(2);

7. Destroy the instance.

tabs.destroy();

Simple Fast Tabs, Vanilla JavaScript Tabs Plugin/Github


See Demo And Download

Official Website(zoltantothcom): Click Here

This superior jQuery/javascript plugin is developed by zoltantothcom. For extra Advanced Usages, please go to the official website.

Related Posts

Confetti-Falling-Animation-Effect-party

Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

jquery-cookie-consent

Simple jQuery Cookie Consent Plugin

jquery.cookie-consent is a simple jQuery plugin to request consent to use cookies. An easy-to-use and highly customizable cookie consent bar that informs your visitors of the use…

Timepicker-Plugin-for-jQuery

Timepicker JavaScript Plugin for jQuery Inspired by Google Calendar

jquery.timepicker is a lightweight jQuery timer plugin inspired by Google Calendar. It supports both mouse and keyboard navigation and weighs 5.5KB minified and compact. Features: Highly customizable…

angular-ngx-carousel-slider

A Lightweight, Touchable, and Responsive Angular Universal Carousel Library

ngxCarousel is a lightweight, tactile, and responsive library for creating an angular carousel. No dependencies, no more hammer. Must Read: Angular Responsive Image Slider With Lightbox Popup…

vue-fullpage-modal

First Mobile Full-screen Modal Popup Library For Vue

Vue full-page modal is a responsive, mobile-compatible, screen-friendly pop-up library for Vue.js. Must Read: Modal Component Is Written in Vanilla JS | ensemble Modal How to make…

random-number-picker

Generate a Random Number Picker In Vanilla JavaScript

Random Number Picker is a Vanilla JS-based number picker that allows you to generate a random number within a specified range. Must Read: Generating Lottery Numbers Using…