For a website I need one horizontal menu in Bootstrap 4 (.container) after the header (.container-fluid) which should collapse into right sidebar using slideout.js.
Currently I have horizontal menu (code below) but I can't figure out how to properly collapse items for slideout. How can I do it?
I can't load two menus. If there is any solution I am open to suggestions.
<nav class="navbar navbar-expand-md navbar-light bg-light m-0 p-0" id="menu">
<div class="container">
<div class="collapse navbar-collapse" id="sidebar">
<ul class="navbar-nav mr-auto col align-self-center justify-content-center">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Title
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="link">@lang('titles.link')</a>
<a class="dropdown-item" href="link">@lang('titles.link')</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link 1</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="somesite1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@lang('titles.somesite')
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="somesite1">
<a class="dropdown-item" href="{{url(trans('routes.somesite'))}}">@lang('titles.somesite')</a>
</div>
</li>
</ul>
</div>
</div>
<div class="container-fluid main-header p-0 m-0 fixed">
<div class="container header">
<div class="row text-sm-center text-md-left text-center">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8" style="z-index:1000">
<a class="navbar-brand" href="{{url('/', [app()->getLocale()])}}">
<img src="{{asset('logos/logo.png')}}" class="nav-logo" alt="Logo">
</a>
<button class="navbar-toggler d-md-none menu-icon" type="button" id="toggle-button" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-expanded="true" aria-label="Toggle navigation">
<span class="navicon"></span>
</button>
</div>
<div class="col-md-4 text-md-right d-none d-md-block phone-data">
some phone data
</div>
</div>
</div>
</div>
@includeIf('components.navigation')
<main id="panel">
</main>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…