1

I am trying to create dropdown menu using Bootstrap Twitter. I need to have submenu that has width same as main menu, and is placed below it.

Bootstrap provide us only with standard dropdown menu that is placed right below the clicked li item and width dependent on this li. It is of course understandable as submenu is child of clicked li, but do you have any easy tricks to make it change? Or the only solution is to write my own dropdown for this?

What is more, I need it responsive.

4

3 回答 3

0

To do this with jQuery

$(".dropdown-menu").css("padding","0 100%");
$(".dropdown-menu").css("margin","0 -100%");
于 2014-02-14T23:52:34.757 回答
0

您可以调整 .dropdown-submenu 的 CSS 以使其显示在其父下拉菜单下方。

例如,

.dropdown-submenu .dropdown-menu{
    left:10px;
    top:32px;
}

演示

于 2013-05-08T13:34:52.183 回答
0

您可以将这些样式添加到子菜单(只需替换您需要匹配父元素的填充/边距的大小)

.dropdown-menu {
    padding:0 100%;
    margin: 0 -100%;
  }

演示

于 2013-05-08T14:11:03.190 回答