somewebmedia / hc-offcanvas-nav

JavaScript library for creating toggled off-canvas multi-level navigations, allowing endless nesting of submenu elements, supporting swipe gestures, keyboard interactions and ARIA attributes.
https://somewebmedia.github.io/hc-offcanvas-nav/
MIT License
336 stars 82 forks source link

Attach menu onto some other parent than body #84

Open gitarmartin opened 2 years ago

gitarmartin commented 2 years ago

Hi!

I understand that the menu HC Off-canvas Nav is designed to attach to body, but in our use case, we have a chatbot tray where we want to nest this menu.

  1. How to attach onto some parent other than body?

  2. Additionally, it would need to display permanently, not hide as it is part of the tray. Permanent displaying would probably be usefull in general. Disable close buttons and actions (key presses etc.).

  3. And also disable the overlay (unsure if this is needed with 1 but definitely with 2).

Our plan to use it to serve context specific user instructions.

What would you recommend? Thanks.

somewebmedia commented 2 years ago

I think attaching it to any element could be implemented, but I'll have to play around with it to see if that would break something.

And for everything else you asked these settings would do the work:

expanded: true,
closeOnClick: false,
closeOnEsc: false,
disableBody: false