Questo è il codice del file css contenente le istruzioni per il responsive:
codice:
@media screen and (max-width: 1120px) {
html {
padding: 0;
}
header{
border-radius: 0;
}
section{
border-radius: 0;
}
aside{
border-radius: 0;
}
}
@media screen and (max-width: 860px) {
nav ul li{
width: 16.66%;
float: left;
}
nav ul li#destra {
width: 50%;
float: left;
}
nav {
height: 100px;
}
aside {
display: none;
}
section {
width: 100%;
}
}
@media screen and (max-width: 712px) {
section {
}
header {
display: none;
}
nav ul {
width: 0;
background: #aaaaaa;
height: auto;
padding, margin: 0;
color: blue;
float: left;
margin-top: 50px;
overflow: hidden;
transition: all 300ms linear;
}
nav ul li, nav ul li#destra{
display: block;
//clear: both;
float: none;
width: 100%;
border-bottom: none;
border-left: 5px solid;
}
nav ul li a {
text-align: left;
}
nav {
height: 50px;
z-index: 0;
float: none;
}
a#menu {
display: inline-block;
line-height: 50px;
}
}
Mentre questo è il codice in javascript per fare in modo che nella versione mobile ci sia il menu nascosto:
codice:
jQuery(document).ready(function() {
var show = 0;
$('#menu').click(function() {
if(show == 0) {
$('nav ul').css({width: '50%'});
show = 1;
}else {
$('nav ul').css({width: '0'});
show = 0;
}
});
});
Ho letto su alcuni siti che c'è un comando in javascript per risolvere questo problema ma non ho capito un granché.