Material Design Lite固定头不响应

时间:2019-07-16 03:31:11

标签: responsive-design material-design-lite

我从https://getmdl.io/components/index.html#layout-section复制了基本的固定标头标记,但似乎无法使菜单正常工作。菜单不会随屏幕尺寸缩小,并且不会响应任何单击事件。

我尝试将标记用于页面上的演示版式,因此我可以看到菜单按钮,但仍然无法打开和显示菜单。

<!-- Always shows a header, even in smaller screens. -->
    <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
        <header class="mdl-layout__header">
            <div class="mdl-layout__header-row">
                <!-- Title -->
                <span class="mdl-layout-title">Title</span>
                <!-- Add spacer, to align navigation to the right -->
                <div class="mdl-layout-spacer"></div>
                <!-- Navigation. We hide it in small screens. -->
                <nav class="mdl-navigation mdl-layout--large-screen-only">
                    <a class="mdl-navigation__link" href="">Link</a>
                    <a class="mdl-navigation__link" href="">Link</a>
                    <a class="mdl-navigation__link" href="">Link</a>
                    <a class="mdl-navigation__link" href="">Link</a>
                </nav>
            </div>
        </header>
        <div class="mdl-layout__drawer">
            <span class="mdl-layout-title">Title</span>
            <nav class="mdl-navigation">
                <a class="mdl-navigation__link" href="">Link</a>
                <a class="mdl-navigation__link" href="">Link</a>
                <a class="mdl-navigation__link" href="">Link</a>
                <a class="mdl-navigation__link" href="">Link</a>
            </nav>
        </div>
        <main class="mdl-layout__content">
            <div class="page-content">
                <!-- Your content goes here -->
            </div>
        </main>
    </div>

我希望显示一个菜单按钮,以响应单击事件,并在调整屏幕时使菜单显示一些响应。

0 个答案:

没有答案