Hi guys, I'm using the following script to toggle a menu/div: <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> Code (markup): <div id="foo"><a href="#" onclick="toggle_visibility('foo');">Test</a></div> Code (markup): However, currently it is automatically set to show, and then close when you click on it. How can I enable it so it's default set to hide, and on click, it shows the div? Also, it seems to require one click on the link before it kicks into action, how can I overcome this? If these issues can be fixed with this script that will be great, but if you have any alternative scripts, I guess they would be okay. Thanks in advance!
Hmm,, that doesn't seem to make a difference. The div still loads when the page is shown, rather than starting off hidden.