html - Issue closing the responsive menu -


i have problem responsive menu , can't figure out it.

it's hard explain go website http://untruste.altervista.org/home.html

now resize windows since responsive version, open menu , close it.

resize window since desktop version, u can see menu disappeared! (if refresh page comes back)

desktopstyle:

    header {     padding-bottom: 2%;     border-radius: 10px;     width: 70%;     margin: auto; }  #headertitle h1{     display: block; }  #headertitle {     padding-top: 1%;     text-align: center;     line-height: 1.8em; }  header img {     display: block;     margin: 2%;     width:7em; }  header h1 {     width: 80%;     margin: auto;     font-size: 1.8em;     letter-spacing: -0.04em; }  header h2 {     width: 50%;     margin: auto;     text-align: center;     font-size: 1.5em;     letter-spacing: -0.06em; }  #menu {     display: block;     width: 80%;     margin: auto;     border:none }  #menu ul li {     display: inline-block;     width:auto;     margin-left:auto;     margin-right: auto;     padding:2px;     border: none;     font-size: 0.9em; }  #selected {     background: #00715f;     padding:0 1em;     color: #ffffff !important;     border-radius: 10px; }   article {     width: 70%;     padding-top: 1%;     border-radius: 10px;     font-size: 0.9em; }  article {     color: #004040 }  article h1 {     padding: 7px 7px 7px 30px;     width:auto;     margin-left: -30px;     margin-right: 30%;     text-align: left; }  article h2 {     margin-left: -30px;     margin-right: 60%; }  .articletext {     width:70%;     margin:auto; }  #linkmap {     display: none; }  iframe {     display: block;     border: none; }  footer {     width:70%;     margin: auto;     border-radius: 10px;     font-size: 0.9em;     font-family: times, serif; } 

mobilestyle

body { }  header { }  footer {     font-size: 0.7em; }  #headertitle h1{     display: none; }  .icon {     margin-right:10px;     font-size:2em }  .icon::after {     content:'≡'; } .icon-close::after {     margin-right:10px;     font-size:2em;     content:'×';     font-weight: normal;     font-style: normal; }  #headertitle {     padding-top: 5px; }  header img {     display:none }  header h1 {     font-size: 1.4em;     letter-spacing: -0.04em;  }  header h2 {     font-size: 1.1em; }   #menu {     border-bottom: 1em solid #00715f; }   #menu ul li {     display: block;     height:2em;     width:100%;     margin-left:-3.5%;     font-size:1.2em }  .menu_button {     display: block;     text-decoration: none;     text-align: right;     box-shadow:0 1px 1px rgba(0,0,0,0.15);     background: #00715f;     color: #ececec; }  #selected {     background: #00715f;     padding:0 5em;     color: #ffffff !important;     border-radius: 10px; }  article {     width: 100%;     font-size: 0.8em; }  article h1 {     width:100%;     margin-right: 20%;     padding:7px 0 7px 0;     text-align: center; }  article h2 {     margin-right: 10%; }  .articletext {     width:90%;     margin:auto }  #linkmap{     display: block;     border: none; }  iframe {     display: none; } 

style:

body {     background:#004040;     color: #005b4d;     text-align: center;     font-family: "georgia", "times", serif; }  {     color: #00715f; }  a:hover {     font-style: italic; }  header {     background: white;     width: 100%;     height:auto }  header h1,h2 {     display: block;     font-weight: normal; }  footer {     background-color: #ffffff;     width: 100%;     padding: 2% 0; }  #menu ul li {     list-style: none;     text-align: center; }  #menu ul li {     text-decoration: none;     color: #005b4d; }  article {     background: white;     text-align: justify !important;     padding-bottom: 1%;     margin: 5% auto; }  article h1 {     background: #00715f;     color: #fff;     width:100%;     margin-right: 20%;     text-shadow: 0 1px 0 #403232;     font-weight: normal;     text-align: center; }  article h2 {     background: #00715f;     color:#fff;     padding: 7px 7px 7px 30px;     font-weight: normal;     font-size: 1.2em; } 

this html

  <!doctype html>     <html lang="en">     <head>         <meta charset="utf-8">         <link rel="stylesheet"  type="text/css" href="css/style.css">         <link rel="stylesheet" media= "(min-width: 240px) , (max-width:1023px)" type="text/css"               href="css/mobilestyle.css">         <link rel="stylesheet" media="(min-width:1024px)" type="text/css" href="css/desktopstyle.css">         <meta name="viewport" content="width=device-width">         <link rel="icon" href="favicon.ico">         <script src="jquery-1.11.3.js" type="text/javascript"></script>         <script src="script.js"></script>         <!--[if lt ie 9]>       <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>         <![endif]-->         <title>artelab responsive</title>     </head>      <body>     <header>         <img style="float:left" src="logos/artelab.png" alt="logo_artelab">         <img style="float: right" src="logos/insubria.png" alt="logo_insubria">         <div id="headertitle">             <h1>applied recognition technology laboratory</h1>             <h2>department of theoretical , applied science</h2>         </div>         <a class="menu_button"  href="#"><span class="icon">≡</span> </a>         <div id='menu'>             <nav>                 <ul>                     <li><a href="link">link1</a></li>                     <li><a href="link">link2</a></li>                     <li><a href="link">link3</a></li>                     <li><a href="link">link4</a></li>                     <li><a href="link">link5</a></li>                     <li><a id="selected" href="link">link6</a></li>                 </ul>             </nav>         </div>     </header> 

and script use open menu in responsive version

jquery(document).ready(function() {     $('.menu_button').click(function() {         $("#menu").slidetoggle();         $(this).find('span').toggleclass('icon icon-close');     }); }); 

you can try this:

in desktop styles :

#menu {      display: block!important; } 

your slidetoggle() menu causing have display:none in style attribute. overwrite in desktop.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -