Hi there, I’d like to make the navigation bar in www.sntravel.co.uk homepage more responsive.
At the moment it just becomes taller in height when the width of the screen gets smaller and disappears on mobiles as it would take too much space off the page.
Is there a way to make it become a menu so that when they tap the menu icon it would cascade into the navigation, but vertical ?
Yes, use media queries. When you get below a certain width, change up the CSS for hte navigation. Many frameworks actually use a second navigation placed elsewhere (if needed) and have that displayed when needed in mobile.
@media screen and (max-width: 641px) and (min-width: 420px)
That’s your media query (you should note that 420 isn’t the minimum pixel width that is available on mobile)…
Well when you get to mobile width (under a certain size) you can either reformat it with CSS, or display:none; it to make it go away, and for the MOBILE menu, make that appear via display:block; (have that display:none’d for non-mobile view)
Edit: That’s assuming you want two different menus. If you can reformat the single menu then by all means, do it.
I tried but I can see just a text, not the navigation bar of the example.
After I click it slides but doesn’t move the content to the right and merges with it.
If you go to http://www.sntravel.co.uk/switchview.pl?list=1
and choose the second option (navnew) you will see the test environment where the script is still up so you can see the source code.
Where is the Javscript file? Did you include that? I don’t see it. And the header is overlapping the red bar so I had to manually change that z-index to 1000 to override your header just so I could activate the slider.
Carefully go over my example code. Make sure all files and code are accounted for. HTML looks good - but JS, CSS? I don’t see everything. Can you find it ?