滚动条添加到bootstrap 2.3.2中的下拉菜单时未显示子菜单

时间:2014-07-24 10:47:09

标签: twitter-bootstrap drop-down-menu

<html>
<head>
    <style>
        .scrollable-menu {
            max-height : 200px;
            overflow-y : auto;  
        }

    </style>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.css" type="text/css"/>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="bootstrap/js/bootstrap.js"></script>
</head>
<body>
    <div class="dropdown">
        <a href="#" data-toggle="dropdown" class="dropdown-toggle">Program <b class="caret"></b></a>
        <ul class="dropdown-menu scrollable-menu" >
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Reach</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Reach For Reading</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Science</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">World Culture and Geography</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Test</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Inside</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Edge</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a tabindex="-1" href="#">Our World</a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="#">Level1</a></li>
                    <li><a tabindex="-1" href="#">Level2</a></li>
                    <li><a tabindex="-1" href="#">Level3</a></li>
                    <li><a tabindex="-1" href="#">Level4</a></li>
                    <li><a tabindex="-1" href="#">Level5</a></li>
                    <li><a tabindex="-1" href="#">Level6</a></li>
                    <li><a tabindex="-1" href="#">Level7</a></li>
                </ul>
            </li>
        </ul>
    </div>  
</body>

我正在制作带有bootstrap的下拉菜单。当下拉菜单的高度高于屏幕尺寸时,我试图向其添加滚动条。正确添加滚动条但问题是现在子菜单未显示。他们是隐藏的。

0 个答案:

没有答案