单击另一个选项卡后,引导程序选项卡消失 [英] Bootstrap tabs disappear after clicking onto another tab

查看:106
本文介绍了单击另一个选项卡后,引导程序选项卡消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用CSS技巧来尝试保持选项卡保持显示状态,但是我单击的所有内容均会消失-当我单击另一个选项卡后,该内容便会消失.

I've tried CSS tricks to try and keep the tabs to stay appearing, but everything I click a tab - it disappears as soon as I click onto another tab.

我尝试过移动JS代码,并将某些CSS属性移动到页面底部的选项卡代码下方;什么都没发生.

I tried moving the JS code around and moving certain CSS attributes to the bottom of the page, beneath the tab code; nothing happens.

是否有可能因为我在标题上有一个选项卡而这样做了?

Could it be possible that because I have a tab on the header, that it's doing this?

代码和选项卡在一起看起来不错,没有拼写错误.

the code and tabs together looks ok, no misspellings.

推荐答案

     $(document).off('click.tab.data-api');
    $(document).on('click.tab.data-api', '[data-toggle="tab"]', function (e) {
        e.preventDefault();
        var tab = $($(this).attr('href'));
        var activate = !tab.hasClass('active');
        $('div.tab-content>div.tab-pane.active').removeClass('active');
        $('ul.nav.nav-tabs>li.active').removeClass('active');
        if (activate) {
            $(this).tab('show')
        }
    });

这篇关于单击另一个选项卡后,引导程序选项卡消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆