PDA

View Full Version : Switch menu 2.2 top item and sub item confusion



gazanson
10-17-2006, 07:53 AM
1) Script Title: Switch Menu v2.2.

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

3) Describe problem: I have a menu consisting of a number of main divs. Some just have linked top items; others have regular linked sub items. It's easy enough to hyperlink the top items, but when I remove the [bolded] code for the sub items included with that main div, the next main div list loses its functionality. See example code pasted below. Can someone tell me what changes I need to make to the code to achieve this mix of linked top and sub items without upsetting the following main div function? I have tried various coding combinations but without success. I'm sure the answer is staring me right in the face, but ...

With many thanks

Gary

------------------------
<html>
<head>
<link rel="stylesheet" type="text/css" href="scripts/sddm.css">
<title>XXX</title>
</head>

<body>
<div class="navbar">
<!-- *********************************Start Menu****************************** -->
<div class="mainDiv">
<div class="topItem"><a href="index.html">HOME</a></div>
<div class="dropMenu"><!-- -->
<div class="subMenu hide">
<div class="subItem"><a href="#">name</a></div>
</div>
</div>
</div>
<!-- *********************************End Menu****************************** -->
<!-- *********************************Start Menu****************************** -->
<div class="mainDiv">
<div class="topItem">ABOUT US</div>
<div class="dropMenu"><!-- -->
<div class="subMenu" style="display: none;">
<div class="subItem"><a href="about_intro.html">INTRO</a></div>
<div class="subItem"><a href="#">Courses</a></div>
<div class="subItem"><a href="#">Training</a></div>
</div>
</div>
</div>
<!-- *********************************End Menu****************************** -->
<!-- *********************************Start Menu****************************** -->
<div class="mainDiv">
<div class="topItem">COURSES</div>
<div class="dropMenu"><!-- -->
<div class="subMenu" style="display: none;">
<div class="subItem"><a href="#">INTRO</a></div>
<div class="subItem"><a href="#">Beginners</a></div>
<div class="subItem"><a href="#">Advanced</a></div>
</div>
</div>
</div>
<!-- *********************************End Menu****************************** -->
<!-- *********************************Start Menu****************************** -->
<div class="mainDiv">
<div class="topItem">CONTACT US</div>
<div class="dropMenu"><!-- -->
<div class="subMenu" style="display: none;">
<div class="subItem"><a href="#">INTRO</a></div>
<div class="subItem"><a href="#">Training Division</a></div>
<div class="subItem"><a href="#">Documentation</a></div>
</div>
</div>
</div>
<!-- *********************************End Menu****************************** -->
</body>
</html>

pmartins
09-20-2007, 06:08 PM
Have the same problem, anybody have a solution??