Tiny Flexible jQuery Responsive Tabs Plugin mTab - Download Responsive Tabbing with Accordion In Mobile View - mTab

Download Responsive Tabbing with Accordion In Mobile View – mTab

Posted on

This time I will share jQuery Plugin and tutorial about Responsive Tabbing with Accordion In Mobile View – mTab, hope it will help you in programming stack.

Tiny Flexible jQuery Responsive Tabs Plugin mTab - Download Responsive Tabbing with Accordion In Mobile View - mTab
File Size: 6.96 KB
Views Total: 6384
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

mTab is a lightweight (~4kb unminified) jQuery plugin to create a responsive tabbed interface that automatically switch between tabs view and accordion view according to a specified breakpoint.

Features:

  • Custom active tab.
  • Custom open / close animation.
  • Allows to open tabs with URL.
  • Callback functions.
  • Auto scrolls to top position in accordion view.
  • Custom breakpoint at which you want to switch between tabs view and accordion view.

How to use it:

1. Load the core style sheet mTab-style.css in the head section of the document.

1 <link href="css/mTab-style.css" rel="stylesheet">

2. The required markup structure for the tabbed interface.

01 <div class="tabbing">
02   <ul class="tabNav">
03     <li><a href="#tab1">tab 1</a></li>
04     <li><a href="#tab2">tab 2</a></li>
05     <li><a href="#tab3">tab 3</a></li>
06   </ul>
07   <div class="tabContainer">
08     <div class="tabContent" id="tab1">
09       <h3>Tab Content 1</h3>
10       <p>More Content Here</p>
11     </div>
12     <div class="tabContent" id="tab2">
13       <h3>Tab Content 2</h3>
14       <p>More Content Here</p>
15     </div>
16     <div class="tabContent" id="tab3">
17       <h3>Tab Content 3</h3>
18       <p>More Content Here</p>
19     </div>
20   </div>
21 </div>

3. Load the latest jQuery library and the jquery-mTab-min.js at the end of the document.

1 <script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
2 <script src="js/jquery-mTab-min.js"></script>

4. Active the plugin with default options.

1 $('.tabbing').mTab();

5. Configuration options.

01 // CSS selector for navigtation
02 navigation: ".tabNav",
03  
04 // CSS selector for container
05 container: ".tabContainer",
06  
07 // active tab on page load
08 activeTab: 1,
09  
10 // CSS class for active tab
11 activeClass: "active",
12  
13 // scroll offset
14 scrollOffset: true,
15  
16 // breakpoint in pixels
17 accordScreen: 768,
18  
19 // enable animation
20 animation: false,
21  
22 // open tabs with URL hashes
23 openWithUrl: false,
24  
25 // callback functions
26 callbackonclick: function() {},
27 callback: function() {}

This awesome jQuery plugin is developed by maulinpandya2006. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net