使用Jquery禁用选项卡单击

时间:2017-05-18 13:23:24

标签: jquery html css tabs

我根据标签信息显示数据multiple tabs。我想要的是,我想使用Jquery禁用选项卡。

以下是我正在使用的代码

onTabClick: function (tab, navigation, index) {
        var $current = index + 1;           

        if ($current == 1) {
            return true;
        }
        if ($current == 2) {
            return ChkValidateSiteDetails();
        }
        if ($current == 3) {
            return btnSiteStatusNext();
        }
        if ($current == 4) {
            return btnExpenseIncurredTab();
        }
        if ($current == 5) {
            return btnExpenseRecurredTab();
        }
        if ($current == 6) {
            return btnAdditionalExpensesTab();
        }
        if ($current == 7) {
            return btnReasonForDropTab();
        }
    }, 
    onTabShow: function (tab, navigation, index) {                       

        var $total = navigation.find('li').length;
        var $current = index + 1;
        var $percent = ($current / $total) * 100;
        $('#wizard1').find('.progress-bar').css({ width: $percent + '%' });


       /* $('#wizard1 > .steps li').each(function (index) {
            $(this).removeClass('complete');
            index += 1;
            if (index < $current) {
                $(this).addClass('complete');
            }
        }); */

        if ($current >= $total) {
            $('#wizard1').find('.button-next').hide();
            $('#wizard1').find('.button-finish').show();
        } else {
            $('#wizard1').find('.button-next').show();
            $('#wizard1').find('.button-finish').hide();
            $('#wizard1').find('.button-previous').show();
        }
        if ($current == 1) {
            $('#wizard1').find('.button-next').hide();
            $('#wizard1').find('.button-finish').hide();
            $('#wizard1').find('.button-previous').hide();
        }
    }

我试过here,但它仍然不适合我。我应该如何禁用它。

0 个答案:

没有答案