tabs

选项卡

组件:


未手动选中

第1段文字内容

第2段文字内容

第3段文字内容


第1段文字内容

第2段文字内容

第3段文字内容

功能:

代码示例:

    var tabsSetting = {
        type: '2', // 样式2 - 无边框,选中后标签文字颜色为蓝色
        select: 1 // 默认选中第二个标签
    };

    // 初始化
    $tabs = draw.tools.tabs($('#tabs'), tabsSetting);

    // 选择选项卡事件
    $tabs.on('drawTabSelect',function(e, index) {
      $("#tabs-info").text("选中了:" + index);
    });

    // 选择指定序号的选项卡
    function tabsTest1() {
        var index = (($tabs.tabs('getSelected') + 1) % 3);
        $tabs.tabs('select', index);
    }

    // 获取选中序号
    function tabsTest2() {
        var index = $tabs.tabs('getSelected');
        alert(index);
    }