Código CSS:
Ver original
.menu{ padding-left:0px; margin-top: 0; margin-bottom: 0; list-style: none; background: steelblue; } @media (min-width: 768px){ .menu{ display: flex; } .menu li{ flex: auto; text-align: center; border-right: 1px solid rgba(0,0,0,0.2); } #toggle-menu{ background: steelblue; line-height: 2.5; color: aliceblue; padding: left; font-size: .9em; cursor: pointer; display:none; } } .menu a{ color: aliceblue; text-decoration: none; line-height: 3; display: block; font-weight: bold; font-size: .9em; } .menu a:hover{ background: rgba(0,0,0,0.2); } .menu li { border-bottom: 1px solid rgba(0,0,0,0.2); } #toggle-menu{ background: steelblue; line-height: 2.5; color: aliceblue; padding: left; font-size: .9em; cursor: pointer; }
Código HTML:
Ver original
Código Javascript:
Ver original
/controlar el toggle menu $("#toggle-menu").click(function(){ $(this).next().slideToggle(); }); $(window).on("resize", function(){ if($(this).width()>768){ $("#toggle-menu").next().show(); } });