I'll rewrite all because probably I've not explained myself very well (sorry for my bad english).
I have 2 html pages: index.hmtl and info.html.
All html pages have a div with the name of the page and a small menu icon, when you click on the icon the menu appears and disappears (something like menu in facebook app). to have this switching of visible and invisible I've toggled two classes. If I open my html.it and click on the menu button it works well, the menu appears and disappears.
The menu is an ul with link to others html page. If you click on a link the browser will load that page (ex. info.html) with the same div in the upper part (page name and small icon) and different content. If I click on the icon menu in info.html page the switchig of the menu doesn't work. If i refresh the info.html page the menu icon works showing and hidind the ul menu.
My code in all pages (for the header part) is:
<div id ="header-status" data-role="header" data-position="fixed" data-theme="a">
<img id="menu" src="img/menu.png" /> <h2>Pas.si</h2>
</div>
<ul id="listamenu" class="classmenua">
<li> <a href="index.html"> Percorsi </a> </li>
<li> <a href="info.html"> Info </a> </li>
<li> <a href="ARworld.html"> World </a> </li>
</ul>
<div class="content">
[..........]
</div>
<script type="text/javascript">
$('#menu').click(function() {
$('#listamenu').toggleClass('classmenub', 'classmenua');
}
);
</script>
css class used are in a css file loaded in all html pages. this is css of this part:
#listamenu{ width:80%;
height:100%;
background-color:#0CF;
margin:0;
position:absolute;
padding:0;
}
#listamenu li{ list-style:none;
padding:10px;
color:#fff;
}
#listamenu li a{ color:#fff;
font-weight:normal;
}
#listamenu li:active{ color:#0CF;
background-color:#fff;
}
.classmenua{ visibility:hidden;
z-index:-1;
}
.classmenub{ visibility:visible;
z-index:1;
}
return false; doesn't work.
.toggleClass('classmenub classmenua') work to switch the menu but gives the same error if i go in another page
console gives no errors, i'm testing on firefox, last update :D
Hope you can understand now XD sorry again