Code Monkey home page Code Monkey logo

jquery-multitabs's Introduction

jQuery-multitabs

The easiest way to get up and running with nested tabs.

Installation

cdn:

<link href="//unpkg.com/[email protected]/src/css/jquery-multitabs.css">
<script src="//unpkg.com/[email protected]/src/js/jquery-multitabs.js"></script>

npm:

npm i jquery-multitabs

Usage

<div class="tab1">
  <div class="tab__header">
    <div class="tab__header-1 tab__header--active">Tab 1</div>
    <div class="tab__header-2">Tab 2</div>
    <div class="tab__header-3">Tab 3</div>
  </div>
  <div class="tab__content">
    <div class="tab__content-1 tab__content--active">
      <div class="tab">
        <div class="tab__header">
          <div class="tab__header-1 tab__header--active">Sub Tab 1</div>
          <div class="tab__header-2">Sub Tab 2</div>
          <div class="tab__header-3">Sub Tab 3</div>
          <div class="tab__header-4">Sub Tab 4</div>
        </div>
        <div class="tab__content">
          <div class="tab__content-1 tab__content--active">Sub Tab Content 1</div>
          <div class="tab__content-2">Sub Tab Content 2</div>
          <div class="tab__content-3">Sub Tab Content 3</div>
          <div class="tab__content-4">
            <div class="tab">
              <div class="tab__header">
                <div class="tab__header-1 tab__header--active">Sub Tab Level 3 - 1</div>
                <div class="tab__header-2">Sub Tab Level 3 - 2</div>
              </div>
              <div class="tab__content">
                <div class="tab__content-1 tab__content--active">Sub Tab Content Level 3 - 1</div>
                <div class="tab__content-2">Sub Tab Content Level 3 - 2</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="tab__content-2">Tab Content 2</div>
    <div class="tab__content-3">Tab Content 3</div>
  </div>

You can nest unlimited tabs, here are several examples.

To get up and running with the plugin, all you have to do is:

$(function() {
  $('.tab1').multitabs();
});

Roadmap

  • More flexibility to add nested tabs (right now it only supports 1 extra level of nested tabs).
  • An API to add, remove a tab.
  • ... More to come

Changelog

1.1.0

  • Removed data-child attribute dependency, allowing unlimited nested tabs.

This project is licensed under MIT.

jquery-multitabs's People

Contributors

marco3211 avatar

Stargazers

Cody Benner avatar Artem Mozhaev avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.