ebagtheftp
Technical User
I'm making a website and in it, I have it so that the menu is hidden by default and when you click a button it shows the menu.
A simplified version of what i'm using is this:
I'm trying to make it so that when you click a link in the menu it will load the new page with the menu showing.
It occurred to me that maybe appending a '#' to the end of the link, thus differentiating the 'toggled' link from the 'hidden' one, and then somehow making the page detect that and toggling the menu.
Assuming that makes any sense, I have no idea where to start...
I was thinking of something like this, but really I have no idea... <_<
I would really appreciate any help.
A simplified version of what i'm using is this:
Code:
<html>
<head>
<title>menu</title>
<script type="text/javascript">
function toggleMenu(list, img){
var listElement = document.getElementById(list);
listElement.style.display = (listElement.style.display == "none") ? "block" : "none";
img.src = (img.src == "images/menu.jpg");
}
</script>
<head>
<body>
<div id="menu head"><img title="Click here to toggle the menu" src="images/menuhead.jpg" onclick="toggleMenu('menu', this)"/></div>
<div id="menu" style="display:none;"><img src="images/menu.jpg"/></div>
</body>
</html>
I'm trying to make it so that when you click a link in the menu it will load the new page with the menu showing.
It occurred to me that maybe appending a '#' to the end of the link, thus differentiating the 'toggled' link from the 'hidden' one, and then somehow making the page detect that and toggling the menu.
Assuming that makes any sense, I have no idea where to start...
I was thinking of something like this, but really I have no idea... <_<
Code:
<script type="text/javascript">
function getURL()
{
var url = document.URL;
removeDomainName = url.split(".html");
if ( # == DomainName ) return domainName;
return true;
document.onLoad.toggleMenu = ('menu', this);
}
</script>
<body onLoad="getURL()">