Logic for horizontally scrolling between sidebar menus #1882
Unanswered
stackerito
asked this question in
1. Help
Replies: 1 comment 3 replies
-
I would have two panels, one for the main static, top-level menu items, and another that is dynamically generated when the user pressed a menu item. That way you only need to manage movement between two panels. Before you add menu items, you can just manage the movement first with generic buttons that go forward and back. After you have that down, iterate over your data to add in the items. Here's one I quickly put together just now. maybe you can get some tips from it: https://codepen.io/KevinBatdorf/pen/qBmKOQN?editors=1010 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying for a few days to think about the best approach for scrolling horizontally between the menus and sub-menus of the sidebar.
I'm using tailwind css and this is how the sidebar looks: (I left the
overflow-x-scroll
so you can see the menus)https://play.tailwindcss.com/XGj81cS2wm
I tried at first to use
x-show
for each sub-menu and thentranslate
withx-transition
(enter
andleave
).But I think it's bad because I have to manually set the translate width depending on the position of the menu. and it's not dynamic, so if I want to add more menus I will have to redo it.
Also it doesn't sync nice together..
How can I do it?
Beta Was this translation helpful? Give feedback.
All reactions