In my design, I have a left main menu set to a fixed position and with a width of 90px. To enhance user experience, I want to add a secondary flyout menu that slides out from under the main menu, moving from left to right. The flyout menu should also have a fixed position but can vary in width. I plan to implement this slide-out effect using CSS transitions.
Before sliding out, the flyout menu will sit right at the edge of the main menu, ready to transition smoothly:
After sliding out, it will reveal its full content:
To determine the final position of the flyout menu, I can use 'left: 0' with a margin-left equal to the width of the main menu (90px). However, I'm struggling to figure out how to set the initial position so that the flyout menu starts flush against the right edge of the main menu, allowing for a seamless transition to the final position without any delay.
My current attempt involves starting with 'left: -100%', but this places the flyout menu too far to the left, resulting in a noticeable delay before it begins emerging from underneath the main menu.