We need to import CSS and js
<link type="text/css" href="assets/css/tab.css"rel="stylesheet" />
<script src="assets/js/tab.js" type="text/javascript" ></script>
Now, we can create a tab. We add a script to our page:
tab({
tabList: 5,
curIndex: 3,
changeMethod: 'vertical',
mouse: 'click',
autoPlay: false
});
Default configuration param
var defaultConfig = {
tabList: 5,
curIndex: 1,
mouse: 'click',
changeMethod: 'default',
autoPlay: false
}
- tabList The number tab
- curIndex Show the current tab
- mouse mouse : click / hover click or mouseover handler
- changeMethod changeMethod: default/vertical/horizontal/opacity The way to switch content
- autoPlay autoPlay : false/true Is swicth by auto