Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Меню выдвигается с боку"
Bootstrap 4.1.1 Snippet by
irbees2008
4.1.1
jQuery
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
544
 
0 Fav
Post to Facebook
Tweet this
<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
Free Template
Get Shit Done Kit
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76