shelton
11-06-2003, 03:21 PM
On this page:
http://williamlatimer.com/council/council2.htm
I am using a javascript for the expandable menu. I want the menu to retain it's 'state' as you navigate around.
The current page you see is a similation of a page called 'Submitting a Proposal' that would be nested within the site. But, as you can see, the menu does not expand 'onload' for the particular page you may be on. I have however, via css, highlighted the section you may be in, but you have to manually open that menu to see the location of the current page, which is bolded.
I am trying to add an if statement within the page source to cause a particular nested ul to display as well as adjust the state of the triggering link (the link with the plus sign, needs to be a minus sign and upon 'click' it should close up that menu).
But... I am JS challenged.
Here's my attempt, where function() refers to the linked javascript file called menuExpandable2.js.
I know of 2 problems with it: 1. actuator.onload (is this valid?) 2. all of the submenus share the class name 'menu' so I don't know how to tell it to expand that particular menu.
<script type="text/javascript">
<!--
if(window.location == "http://tlhweb014/council/council2.htm" {
actuator.onload = function() {
var display = menu.style.display;
this.parentNode.style.backgroundImage =
(display == "block") ? "url(i/menminus.gif)";
menu.style.display = (display == "block") ? "none" : "block";
return false;
}
}
//-->
</script>
http://williamlatimer.com/council/council2.htm
I am using a javascript for the expandable menu. I want the menu to retain it's 'state' as you navigate around.
The current page you see is a similation of a page called 'Submitting a Proposal' that would be nested within the site. But, as you can see, the menu does not expand 'onload' for the particular page you may be on. I have however, via css, highlighted the section you may be in, but you have to manually open that menu to see the location of the current page, which is bolded.
I am trying to add an if statement within the page source to cause a particular nested ul to display as well as adjust the state of the triggering link (the link with the plus sign, needs to be a minus sign and upon 'click' it should close up that menu).
But... I am JS challenged.
Here's my attempt, where function() refers to the linked javascript file called menuExpandable2.js.
I know of 2 problems with it: 1. actuator.onload (is this valid?) 2. all of the submenus share the class name 'menu' so I don't know how to tell it to expand that particular menu.
<script type="text/javascript">
<!--
if(window.location == "http://tlhweb014/council/council2.htm" {
actuator.onload = function() {
var display = menu.style.display;
this.parentNode.style.backgroundImage =
(display == "block") ? "url(i/menminus.gif)";
menu.style.display = (display == "block") ? "none" : "block";
return false;
}
}
//-->
</script>