PDA

View Full Version : Switch Menu not working on Safari



goldd1gger
07-16-2008, 02:12 PM
1) Script Title: Switch Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm

3) Describe problem: When I click on a menu item to expand the submenu, it quickly expand and collapse. This is on Safari v3.1.2 on Windows. I noticed that it does the same thing on MacOSX. Can someone please help?

The thing is that when the menu is clicked, it is supposed to both open a page and expand the submenus. It's only open the index.php. The submenu items are expanded and then, collapsed.

<div class="menutitle" onclick="SwitchMenu('sub2')"><a href="index.php" class="menutit">General Info</a></div>
<div class="submenu" id="sub2">
<ul>
<li><a href="abputsite.php">About Site</a></li>
<li><a href="whatsnew.php">What's New</a></li>
...
</ul>
</div>

However, if I modified the code so that instead of opening "index.php", it open into itself (#). The menu is expanded and stay expanded. Why?

<div class="menutitle" onclick="SwitchMenu('sub2')"><a href="#" class="menutit">General Info</a></div>
<div class="submenu" id="sub2">
<ul>
<li><a href="abputsite.php">About Site</a></li>
<li><a href="whatsnew.php">What's New</a></li>
...
</ul>
</div>