Reputation Activity
-
If you want the menu to just change appearance CSS media queries should be enough.
If you want a toggle button to show/hide the menu you will need a little JavaScript function to change the display property of the menu.
If you want dropdowns it can be done with CSS :hover but I will recommend JavaScript as hover-dropdowns can cause some problems on touch devices especially if the parent-menu item also is a link.
In that case it has both a hover and (the default) click event attached and a touch device can only trigger one of the events.
-
You technically dont need any JavaScript. You can use a hidden checkbox with a linked label styled like a toggle button. You can then use the css :checked psudeo along with the adjacent child selector. That said I still prefer to use JS for mobile menu toggling. It's cleaner. I wrote about how to deal with dynamic navigation that works well with touch and mouse based devices http://rbrtsmith.com/2014/12/a-more-robust-dynamic-navigation-system/