带有主题的Drupal 8 Megamenue

问题描述 投票:0回答:1

现在网站上的设计已接近完成,但该菜单在移动版本中不起作用。他向我展示了第二个切换菜单,但实际上他应该打开侧栏,看看我是否激活了twigdebug。

谢谢

https://b23de.pfadi-effretikon.ch

page.header.twig:

<header id="header" class="header" role="header">
  <div class="container">
    {% if logo %}
      <a id="logo" href="{{ front_page }}" title="{{ 'Home'|t }}" rel="home">
        <img src="{{ logo }}" alt="{{ 'Home'|t }}"/>
      </a>
    {% endif %}
    <button type="button" class="navbar-toggle" data-target="#main-menu-inner" data-toggle="collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    {% if site_name or site_slogan %}
      <div class="name-and-slogan">

effi.js:

 Drupal.Effi.mobileMenu = function() {
      $('#main-menu-inner').off();
      $('#main-menu-inner').on('click', function(){
          $(' .navbar-toggle.collapsed').trigger('click');
      });
    }

we-megamenu-frontend.html.twig:

<div class="region-we-mega-menu">
    <a class="navbar-toggle collapsed">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </a>
    <nav {{ attributes }}>
      <div class="container-fluid">
        {{ content }}
      </div>
    </nav>
</div>
javascript html drupal-8
1个回答
0
投票

感谢@Ronnie,现在错误没有出现,但菜单相同...

    Drupal.Effi.mobileMenu = function() {
      $('#main-menu-inner').mobileMenu();
    }

© www.soinside.com 2019 - 2024. All rights reserved.