"Меню выдвигается с боку"
Bootstrap 4.1.1 Snippet by irbees2008

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <button class="navbar-toggler" type="button" data-toggle="offcanvas"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="#">Navbar</a> <div class="navbar-collapse offcanvas-collapse" id="navbarSupportedContent"> <button class="offcanvas-close" type="button" data-toggle="offcanvas-close"> × </button> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Dropdown </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#">Action</a> <a class="dropdown-item" href="#">Another action</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Something else here</a> </div> </li> <li class="nav-item"> <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li> </ul> </div> </nav> <script src="/examples/vendors/bootstrap-4.3/js/bootstrap.bundle.js"></script>
@media (max-width: 991.98px) { .offcanvas-collapse { position: fixed; top: 0; bottom: 0; left: -300px; width: 300px; padding-top: 3rem; padding-right: 1rem; padding-left: 1rem; overflow-y: auto; visibility: hidden; background-color: #e0e0e0; transition: visibility .3s ease-in-out, -webkit-transform .3s ease-in-out; transition: transform .3s ease-in-out, visibility .3s ease-in-out; transition: transform .3s ease-in-out, visibility .3s ease-in-out, -webkit-transform .3s ease-in-out; } .offcanvas-collapse.open { visibility: visible; -webkit-transform: translateX(300px); transform: translateX(300px); } .offcanvas-close { position: absolute; font-size: 2.5rem; font-weight: 700; cursor: pointer; color: rgba(0, 0, 0, 0.3); border: none; -webkit-appearance: button; background-color: transparent; right: 0; top: 0; padding: 0 1.5rem; } .offcanvas-open { overflow: hidden; } }
$(function () { 'use strict'; $('[data-toggle="offcanvas"]').on('click', function () { $('.offcanvas-collapse').addClass('open'); $('body').addClass('offcanvas-open'); }) $('[data-toggle="offcanvas-close"]').on('click', function () { $('.offcanvas-collapse').removeClass('open'); $('body').removeClass('offcanvas-open'); }) })

Related: See More


Questions / Comments: