JavaScript Tab 切换

  • HTML
  • JavaScript
  • Options
  • Description
<div id="tab-switch">
    <ul class="tabs">
        <li><a href="#">Tab1</a></li>
        <li><a href="#">Tab2</a></li>
        <li><a href="#">Tab3</a></li>
    </ul>
    <div class="panes">
        <div>......</div>
        <div>......</div>
        <div>......</div>
    </div>
</div>
<script>           
new TabSwitch(id, options);
</script>   
选项 默认值 说明
curIndex number » 0 设置默认选中的Tab
tabConCls string » tabs tab容器的类名
paneConCls string » panes pane容器的类名
eventType string » click tab切换的鼠标事件
autoPlay boolean » false 是否自动切换
duration number » 4000 切换间隔时间
history boolean » true 最后点击的tab索引(localStorage)

no description