I'm using a method of showing and hiding my mobile site's nav menu that basically just sets the width of the nav box to 0 width to hide and 80% width to show, using CSS animations and activating by swapping classes with javascript. It's a pretty simple setup.
<snip>
While I kinda like it, it does one thing that kind of annoys me. Because it's changing it's width, the way the text is rendered in the nav box changes as it's being shown and hidden.
Imagine a nav menu that starts at 1px width with overflow hidden. So all text is wider than the box. As the box width grows, the text is still bigger than the box, so more of it is revealed but it isn't moving, it's still pinned to the left edge of the box. As the box gets wider, shorter lines of text start to be less than the width of the box, so they start moving to remain centered. (oh forgot to mention, nav box text is centered). As the nav box continues to get wider, more and more items start moving until the nav box is finished showing itself, and all the text in it is properly centered. But it was a weird 0.5 seconds to get there.
I'd prefer the menu to look the same through the whole process, with essentially a "fixed width" rendering of the menu sliding in from the side, rather than 'growing' in from the side. But I don't want to mess up the site width.
I'm not really sure how to accomplish this, any thoughts?
Also if my description isn't clear, let me know and I'll try to re-explain it.
[edited by: not2easy at 10:24 am (utc) on May 25, 2023]
[edit reason] Please see Charter [webmasterworld.com] [/edit]