OffCanvas菜单基金会6

时间:2016-01-18 15:18:27

标签: php wordpress zurb-foundation-6 off-canvas-menu

刚刚使用Foundation 6在Wordpress中工作,我正在建立一个带有移动画布的菜单。 但我似乎有一个问题,内容没有加载到屏幕外菜单,下面是我正在使用的代码,我把东西放在错误的地方? 外部div(dragoncove_mobile_menu)的原因是我有媒体查询来显示不同大小的不同菜单。我将在下面列出,虽然我已经尝试了没有查询,但没有变化。

<div id="dragoncove_mobile-menu">
<div class="off-canvas-wrapper">
    <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
        <!-- Create off canvas menu -->
        <div class="off-canvas position-left" id="offCanvas" data-off-canvas></div>
        <!-- Content -->
        <div class="off-canvas-content" data-off-canvas-content>
            <?php dragoncove_mobile_slot_1(); ?>
        </div>
    </div>

    <!-- Button Toggle -->
    <button type="button" class="dragoncove_mobile_button" data-toggle="offCanvas">Open Menu</button>

 </div>

.dragoncove_mobile_button {background: none; border: 2px solid #fff; border-radius: 5px; color: #fff; padding:10px;}

/* Small only */
@media screen and (max-width: 39.9375em) {
#dragoncove_desktop-menu {display: none;}
#dragoncove_mobile-menu {display: inline-block;}
}

/* Medium and up */
@media screen and (min-width: 40em) {
#dragoncove_desktop-menu {display: inline-block;}
#dragoncove_mobile-menu {display: none;}
}
</style>        

<!-- Menu's are registered like this -->
// Dragon Cove Mobile Menu Slot 1
function dragoncove_mobile_slot_1() {
     wp_nav_menu(array(
        'container' => false,                           // Remove nav     container
    'menu_class' => 'vertical menu',       // Adding custom nav class
    'items_wrap' => '<ul id="%1$s" class="%2$s" data-responsive-menu="accordion medium-dropdown">%3$s</ul>',
    'theme_location' => 'dc_mobile_menu_slot1',                 // Where it's located in the theme
    'depth' => 5,                                   // Limit the depth of the nav
    'fallback_cb' => false,                         // Fallback function (see below)
    'walker' => new Topbar_Menu_Walker()
));
}

1 个答案:

答案 0 :(得分:1)

快速浏览一下,看起来你错误地解释了它是如何工作的

offcanvas菜单区域包含在

<div class="off-canvas position-left" id="offCanvas" data-off-canvas></div>

所有其他内容都应包含在

<div class="off-canvas-content" data-off-canvas-content>