SwitchTab
Pure javascript tab library (switching tabs by using Ajax), and you can customize your tabs in a fastest way.(also support history API)
Demo
Usage
Include javascript:
<script type="text/javascript" src="your_path/switchTab.js"> <script>
Settings:
var newSwitchTab = new switchTab({ tabClass: 'tab_group', contentId: 'content_container', activeClass: 'tab_active', tabId: ['tab1', 'tab2', 'tab3', 'tab4'], showFirst: 'tab1' });
Setting URL:
Tab-url
is needed for linking to the page you want, this library is using Ajax :D
<div class="tab_group" id="tab1" tab-url="./tab_content1.html"> tab1 </div>
Features & setting details:
- tabClass (string): You use to select your tab group with the same class you create.
- contentId (string): The place you want to put your content.
- afterClass (string): After users select the tab the tab will change to the class, that you set in here.
- tabId (array): The tabs you want to create have to have there own id, and you can set it here. If some of the tab you want to disable just don't fill in the array.
- showFirst (string): Which tab you want to show first.