0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Fix offcanvas example, using a custom trigger selector (#33926)

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
GeoSot 2021-05-11 10:58:45 +03:00 committed by GitHub
parent 9fe36edf68
commit 19f95a3d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ aliases: "/docs/5.0/examples/offcanvas/"
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark" aria-label="Main navigation">
<div class="container-fluid">
<a class="navbar-brand" href="#">Offcanvas navbar</a>
<button class="navbar-toggler p-0 border-0" type="button" data-bs-toggle="offcanvas" aria-label="Toggle navigation">
<button class="navbar-toggler p-0 border-0" type="button" id="navbarSideCollapse" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

View File

@ -1,7 +1,7 @@
(function () {
'use strict'
document.querySelector('[data-bs-toggle="offcanvas"]').addEventListener('click', function () {
document.querySelector('#navbarSideCollapse').addEventListener('click', function () {
document.querySelector('.offcanvas-collapse').classList.toggle('open')
})
})()