将垂直类别菜单转换为手机上的下拉列表

时间:2015-12-02 12:29:59

标签: html css twitter-bootstrap

将垂直类别转换为Bootstrap中的下拉汉堡包列表。我是否需要更改Bootstrap类,或者我是否需要创建下拉列表的HTML / CSS?

<div class="panel panel-default">
<div class="panel-heading">Categories</div>
<div class="panel-body"><ul class="nav nav-pills nav-stacked"><li><a   href="http://example.com/index.php?cPath=1">Category #1</a></li><li><a href="http://example.com//index.php?cPath=2">Category #2</a></li><li><a href="http://example.com//index.php?cPath=3">Category #3</a></li><li><a href="http://example.com/index.php?cPath=21">Category #4</a></li></ul></div>
</div>

1 个答案:

答案 0 :(得分:0)

以下是一些如何对垂直类别执行此操作的示例:

/var/www/sites/example/http/customer/account-settings.twig
/var/www/sites/example/http/index.twig

这里有一个横向类别的汉堡菜单示例:

http://www.internetkultur.at/simple-hamburger-drop-down-menu-with-css-and-jquery/

这是你可以为垂直的那个做的:

<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="navigation">

    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
            <ul class="nav navbar-nav scroll-nav" id="sortableMenuItems">
                <li>
                    <a  href="#">Home</a>
                </li>
                <li>
                    <a  href="#">Menu 2</a>
                </li>
                <li >
                    <a href="#">Menu 3</a>
                </li>
                    <li>
                        <a href="#">Menu 4</a>
                </li>

            </ul>
        </nav>
    </div>
</header>