Hi I have a menu that opens and shuts on click using the code at the bottom, js and html: What I am trying to achieve is when you click the toggle link <a href="javascript:toggle('menu1')" class="folder">Main Home</a> The link goes to the relevant page and expands the menu on that page, at present it opens on the same page the menu is on. I would appreciate any help in achieveing this Thank you, frequenC <!--Script to click expand menu--> <script type="text/javascript"> document.getElementById('leftMenu').style.listStyle="none"; document.getElementById('menu1').style.display="none"; document.getElementById('menu2').style.display="none"; document.getElementById('menu3').style.display="none"; function toggle(list){ var listElementStyle=document.getElementById(list).style; if (listElementStyle.display=="none"){ listElementStyle.display="block"; } else{ listElementStyle.display="none"; } } </script> <!--HML--> <ul id="leftMenu"> <li> <a href="javascript:toggle('menu1')" class="folder">Main Home</a> <li id="menu1"> <ul style="margin-top:-15px"> <li><a href="#">BR Home</a></li> <li><a href="#">About BR</a></li> </ul></li> <li><a href="javascript:toggle('menu2')" class="folder">PNC</a> <li id="menu2"> <ul style="margin-top:-15px"> <li><a href="#">Home</a></li> <li><a href="#">About Us</a></li> <li><a href="#">Toolkit</a></li> <li><a href="#" target="_blank">Leading Practices Library</a></li> <li><a href="#" target="_blank">Results</a></li> </ul></li> <li><a href="javascript:toggle('menu3')" class="folder">Planning</a> <li id="menu3"> <ul style="margin-top:-15px"> <li><a href="/bhpboe/opencms/Business_Planning/index.html">planning Home</a></li> <li><a href="#">The Way of Planning</a></li> <li><a href="#">FAQs</a></li> <li><a href="#">"How To" Guides </a></li> <li><a href="#">Training Dates</a></li> </ul></li></ul>
isn't that just the point of having a dropdown list? if you just want to display the options from the menu on the actual page the visitor wants to visit, then there's no point using it
Currently it just toggles the menu I would like it to work so that when the menu item with the toggle attached is clicked it launches the new page and then the menu item expands in the new page. So how do I add a link to main Home tab to open the main home page and then the menu expanding to show the BR Home and About BR links. <li> <a href="javascript:toggle('menu1')" class="folder">Main Home</a> <li id="menu1"> <ul style="margin-top:-15px"> <li><a href="#">BR Home</a></li> <li><a href="#">About BR</a></li> </ul></li>
i'd go for AJAX: instead of redirecting the user to the home page, you open the page inside the current one by loading it into a div (or iframe, but i would use a div). Search google for "AJAX tutorials", and i'm sure you'll find what you need