现在网站上的设计已接近完成,但该菜单在移动版本中不起作用。他向我展示了第二个切换菜单,但实际上他应该打开侧栏,看看我是否激活了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>
感谢@Ronnie,现在错误没有出现,但菜单相同...
Drupal.Effi.mobileMenu = function() {
$('#main-menu-inner').mobileMenu();
}