简体   繁体   English

如何添加响应式标签菜单并缩小li菜单项Bootstrap?

[英]How to add a responsive tab menu and shrink li menu item Bootstrap?

My website has mega drop-down menu which is built on twitter bootstrap. 我的网站有基于Twitter引导程序的大型下拉菜单。

I tried to add a tabbed menu, which is not bootstrap buil but responsive, to my mega drop down item. 我试图向我的大型下拉菜单添加一个选项卡式菜单,该菜单式菜单不是自举程序,而是响应式菜单。

However, it doesn't fit there well and it wrap whole toggle. 但是,它不太适合此位置,并且包装了整个切换开关。

This is how I add a full width mega dropdown. 这就是我添加全宽超级下拉菜单的方式。

<li class="dropdown full-width"><a href="#" class="dropdown-toggle" data-toggle="dropdown">TEST<b
        class="icon-angle-down"></b></a>
</li>

Here you can VIEW the demo page 在这里您可以查看演示页面

When you hover on item on the navbar 'ILETISIM', it toggles full width, which I exactly want. 当您将鼠标悬停在导航栏“ ILETISIM”上的项目上时,它将切换我完全想要的全宽。 Because I built it with twitter bootstrap 因为我是用twitter引导程序构建的

在此处输入图片说明

However, please check the item 'TEST' . 但是,请检查项目“ TEST” The script that I added later is not twitter bootstrap built, but responsive and it breaks the navbar and makes the item's li full width as shown in the picture below. 我后来添加的脚本不是构建的twitter bootstrap,而是响应式的,它破坏了导航栏并使项目的li全宽,如下图所示。

在此处输入图片说明

I couldn't find any solutions for that until now. 到目前为止,我找不到任何解决方案。

What I want is, it shall behave as same as how 'ILETISIM' item works. 我想要的是,它的行为应与“ ILETISIM”项目的工作方式相同。

I will replace that menu with the new one. 我将用新菜单替换该菜单。

Wrap zozo tabs in a div and give it 100% with like so: 将zozo选项卡包装在div中,并按如下所示进行100%的分配:

<div class="tab-wrapper dropdown-menu">
 zozo tabs here....
</div>

The rest of the issue is related to twitter nav menu. 其余问题与twitter导航菜单有关。 The sub menu show on hover which is inside ul and you have added zozo tabs inside a div. 悬停在ul内部的子菜单显示,并且您在div中添加了zozo选项卡。

/*hide by default*/
.tab-wrapper{
    display: none;
    width: 980px; 
    left: -492.5px;
}
/*display on hover sub menu*/
.navbar ul.nav li:hover > .tab-wrapper {
    display: block;
}

Now there will be some issue with default tab since the whole elements display is set to none. 现在,由于整个元素显示均设置为none,默认选项卡将出现一些问题。

Update : added class tab-wrapper and replaced the css style. 更新 :添加了类tab-wrapper并替换了CSS样式。

Update 2 I realized that your menu is absolute positioned. 更新2我意识到您的菜单是绝对定位的。 So added the same class the to div dropdown-menu which will make it absolute from your style and added some more style. 因此,将相同的类添加到div dropdown菜单中,这将使其绝对脱离您的样式,并添加了更多样式。

Update 3 The mobile dropdown menu shows up because it the element or its container is hidden with display none. Update 3之所以显示移动下拉菜单,是因为该元素或其容器被隐藏而没有显示。 We use the refresh method after its visible. 我们在可见后使用刷新方法。

    $(document).ready(function () {
         /*give your li id of test and it fire on mouseover to refresh the tabs*/
        $("#test").on("mouseover", function () {
            $("#tabbed-nav-02").data('zozoTabs').refresh();
        });
    });

Also could you add tags zozo-tabs and zozo-ui to your stackoverflow post? 您还可以在您的stackoverflow帖子中添加标签zozo-tabs和zozo-ui吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM