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:
parent
9fe36edf68
commit
19f95a3d8d
@ -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>
|
||||
|
||||
|
@ -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')
|
||||
})
|
||||
})()
|
||||
|
Loading…
Reference in New Issue
Block a user