Skip to content

Navbar with autohide function - offcanvas problem #408

Answered by crftwrk
phrizm asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Richard,

This won't work that way because offcanvas navbar is inside the navbar. You are using transform on fixed-top wrapper and of course offcanvas is transformed as well.

You have to create 2 offcanvas menus.

  • Hide existing offcanvas on small devices by adding d-none d-lg-block class to it
  • Copy offcanvas outside the fixed-top div, hide on large devices by adding d-lg-none class. Change id.
  • Change the data-bs-target in navbar-toggler to new offcanvas id.

BTW please mark always solutions as answered. This will others users who want to do the same help to find the solution.

Thanks ;-)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by phrizm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants