![]() |
VOOZH | about |
Bootstrap 5 Offcanvas methods are used to control the visibility of the offcanvas element, manually. For example, they can be used to show, hide, or toggle the Offcanvas element manually.
Bootstrap 5 Offcanvas Usage Methods:
Syntax:
offcanvas.offcanvas_method()Example 1: In this example, we will use "show" and "hide" offcanvas methods to show and hide the offcanvas element manually, with the click of buttons.
Output:
Example 2: In this example, we will use the "toggle" Offcanvas method to toggle (show/hide) the offcanvas element's visibility, manually, with the click of buttons.
Output:
Reference: https://getbootstrap.com/docs/5.0/components/offcanvas/#methods