1. Deslice hacia abajo

Vea el bolígrafo xbxvvp por Alex Caldwell ( @acaldy ) en CodePen .
Here’s the CSS to set it up as a traditional horizontal menu as well as a collapsed menu with a hamburger icon. You’ll notice that the CSS is written in Sass. The heavy lifting happens in the media query at 767px.Vea el bolígrafo xbxvvp por Alex Caldwell ( @acaldy ) en CodePen .
So at a screen width of 767px we show the .menuIcon class where the menu used to be. We also hide the menu with the combination of max-height:0; and overflow:hidden; Then we go through and style everything inside of the menu. The menu options stack with display:block; and span the full width of the page. We also prep the menu with a CSS transition when the max-height is changed with a Sass mixin. Finally here’s the jQuery function that toggles the class .menuOpen:Vea el bolígrafo XBXVVP por Alex Caldwell ( @acaldy ) en CodePen .
2. Deslice

Vea el bolígrafo zyyqwx por Alex Caldwell ( @acaldy ) en Codepen .
Note that I'd normally use a php include for the menu options so that if we update it we only have to change it in one spot, but I can't do that with codepen. There’s also a .mobileDimmer class that we’ll use to fade the body of the website to shift all of the focus to the menu. The initial CSS to set up .menu and hide .mobileMenu looks like this:Vea el bolígrafo Zyyqwx por Alex Caldwell ( @acaldy ) en CodePen .
Entonces hay un par de cosas que suceden aquí. Estamos diseñando. Menu en un diseño horizontal. Estamos configurando el .mobilemenu para apilar las opciones de menú verticalmente y luego ocultarlo con la posición: Absoluto, margen-izquierda: -100%, y visualización: ninguno. También estamos configurando .Mobiledimmer para llenar el cuerpo del sitio con un fondo negro al 50% y un valor de posicionamiento izquierdo del 50% (el ancho del .mobilemenu). Bajo 767px de ancho, nos escondemos .menu y show .Menuicon. También obtenemos .MobileBodyWrapper y .Mobilemenu preparados con la clase de .MenuOpen para la función jQuery Toggle. Cuando agregamos la clase .menuopen a .MobileBodyWrapper, deslizará todo el cuerpo por encima del 50%, lo hará posición: fijo y esconde todo fuera de la ventana de la ventana con desbordamiento: oculto. Cuando agregamos la clase .menuopen a .mobilemenu, cambiará para mostrar: bloquear, margen-izquierda: 0, un ancho del 50%y desbordamiento y: desplazarse. El MobiledimiledMer que configuramos anteriormente cubrirá el cuerpo y tendremos un buen enfoque en el menú a la izquierda a medida que atenuemos el cuerpo a la derecha.Vea el bolígrafo ZyyQWX por Alex Caldwell ( @acaldy ) en CodePen .
Note that it’s set up in a jQuery function so that if the user clicks on the .mobileDimmer it will also close the .mobileMenu, which is good usability. It’s a nice little effect where the focus is put on the menu as the user interacts with it. Hopefully this article sheds some light on how to handle two different menu sizes in a user friendly manner. Creating a menu system that works on both desktop and mobile is challenging.Con el diseño web receptivo, debe usar la pantalla inmobiliaria de la pantalla que le asignan.