Minimal Click Or Hover Triggered Tabs Plugin With jQuery tab js - Download Minimal Click- Or Hover-Triggered Tabs Plugin With jQuery - tab.js

Download Minimal Click- Or Hover-Triggered Tabs Plugin With jQuery – tab.js

Posted on

This time I will share jQuery Plugin and tutorial about Minimal Click- Or Hover-Triggered Tabs Plugin With jQuery – tab.js, hope it will help you in programming stack.

Minimal Click Or Hover Triggered Tabs Plugin With jQuery tab js - Download Minimal Click- Or Hover-Triggered Tabs Plugin With jQuery - tab.js
File Size: 37 KB
Views Total: 4969
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A super small (<1kb) and easy-to-use jQuery tabs plugin which allows the user to switch between tabbed panels by clicking or hovering tab headers.

How to use it:

1. The required html structure for the tabbed interface.

01 <div class="tab tab-demo">
02   <div class="tabHeader">
03     <ul>
04       <li class="active">Tab 1</li>
05       <li>Tab 2</li>
06       <li>Tab 3</li>
07     </ul>
08   </div>
09   <div class="tabContent">
10     <div class="tabItem active">
11       Tab content 1
12     </div>
13     <div class="tabItem">
14       Tab content 2
15     </div>
16     <div class="tabItem">
17       Tab content 3
18     </div>
19   </div>
20 </div>

2. Style the tabbed interface with the following CSS snippets.

01 .tab {
02   width: 600px;
03   height: 300px;
04   border: 1px solid #ccc;
05   margin: 20px auto;
06   background: #fff;
07 }
08  
09 .tabContent > div { display: none; }
10  
11 .tabHeader {
12   height: 50px;
13   line-height: 50px;
14   border-bottom: 1px solid #ccc;
15 }
16  
17 .tabHeader li {
18   float: left;
19   width: 200px;
20   text-align: center;
21   cursor: pointer;
22   background: url(mesh.png) repeat;
23   color: #EFEFEF;
24 }
25  
26 .tabHeader li.active { background: #4D4F4C; }
27  
28 .tabContent .active { display: block; }
29  
30 .tabContent .tabItem { padding: 10px; }

3. Place jQuery library and the Query.tab.js script at the end of the document to improve the page load speed.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="jQuery.tab.js"></script>

4. Call the function and done.

1 $('.tab-demo').tab();

5. Change the default trigger element to ‘hover’.

1 $('.tab-demo').tab({
2   trigger_event_type: 'mouseover'
3 });

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

source : jqueryscript.net