1 Reply Latest reply on Aug 9, 2006 6:51 AM by Newsgroup_User

    Multiple Drop Down Menus

    usatourist
      Hi,

      I have created a drop down using Fireworks and it works fine. However I plan to use bits of this menu on several pages. So I did not want to have the JS code that writes the menu on every page. So I have saved that code to a separate .js file.

      If I use one .js file to define all of the menu items, that file would be very large. But not every page will display all of the menu items. What part of the menu that is displayed will vary among each page. Using one file would require loading a lot of information that would not be necessary. So I split my .js menu file into separate files.

      This is where I have the problem. Only one menu displays. When I hover for the other menus I get the following error:
      'menuLayer' is null or not an object

      This is the code that I am using on the page to display the menus:
      Between the <head> tags
      <script language="JavaScript" src="../../../menus/tips.js" type="text/javascript"></script>
      <script language="JavaScript" src="../../../menus/california.js" type="text/javascript"></script>
      <script language="JavaScript" src="../../../menus/destinations.js" type="text/javascript"></script>
      <script language="JavaScript" src="../../../menus/mm_menu.js" type="text/javascript"></script>

      tips, california and destinations are the menus.

      In the body of the page I have these lines of code to call the menus
      <script language="JavaScript" type="text/javascript">mmLoadMenus()</script>
      <a onmouseover="MM_showMenu(window.mm_menu_california,20,248,'California');" onmouseout=MM_startTimeout(); href="index.html" class="singlesidetitle">California</a>
      <a onmouseover="MM_showMenu(window.mm_menu_cities,20,690,'Cities');" onmouseout=MM_startTimeout(); href="../cities.html" class="sidemenutitles">US Cities</a>
      <a onmouseover="MM_showMenu(window.mm_menu_states,20,723,'States');" onmouseout=MM_startTimeout(); href="../states.html" class="sidemenutitles">US States</a>
      <a onmouseover="MM_showMenu(window.mm_menu_tips,20,954,'Tips');" onmouseout=MM_startTimeout(); href="../tips/index.html" class="sidemenutitles">Travel Tips</a>

      The cities and states menus are defined in the destinations.js file.

      The menu items defined in the destinations.js file display fine. The menu items in the california.js and tips.js files get the error message.

      Any help would be greatly appreciated! Thanks!
        • 1. Re: Multiple Drop Down Menus
          Level 7
          To quote a good friend of mine:

          "Nobody told you? The FW pop-up menus are badly flawed. Depending on the
          complexity of the menu, you might wind up with a 3000 line long CSS file
          (I've seen such posted here).

          There are much better ways to do these menus -

          Check the uberlink and MacFly tutorials at PVII
          ( http://www.projectseven.com/)

          and the Navbar tutorial/articles at Thierry's place
          ( http://tjkdesign.com/navbars/)

          Or to get it done fast, go here -

          http://www.projectseven.com/tutorials/navigation/auto_hide/index.htm "

          You can take that to the bank - alex

          usatourist wrote:
          > Hi,
          >
          > I have created a drop down using Fireworks and it works fine. However I plan
          > to use bits of this menu on several pages. So I did not want to have the JS
          > code that writes the menu on every page. So I have saved that code to a
          > separate .js file.
          >
          > If I use one .js file to define all of the menu items, that file would be very
          > large. But not every page will display all of the menu items. What part of
          > the menu that is displayed will vary among each page. Using one file would
          > require loading a lot of information that would not be necessary. So I split
          > my .js menu file into separate files.
          >
          > This is where I have the problem. Only one menu displays. When I hover for
          > the other menus I get the following error:
          > 'menuLayer' is null or not an object
          >
          > This is the code that I am using on the page to display the menus:
          > Between the <head> tags
          > <script language="JavaScript" src="../../../menus/tips.js"
          > type="text/javascript"></script>
          > <script language="JavaScript" src="../../../menus/california.js"
          > type="text/javascript"></script>
          > <script language="JavaScript" src="../../../menus/destinations.js"
          > type="text/javascript"></script>
          > <script language="JavaScript" src="../../../menus/mm_menu.js"
          > type="text/javascript"></script>
          >
          > tips, california and destinations are the menus.
          >
          > In the body of the page I have these lines of code to call the menus
          > <script language="JavaScript" type="text/javascript">mmLoadMenus()</script>
          > <a onmouseover="MM_showMenu(window.mm_menu_california,20,248,'California');"
          > onmouseout=MM_startTimeout(); href="index.html"
          > class="singlesidetitle">California</a>
          > <a onmouseover="MM_showMenu(window.mm_menu_cities,20,690,'Cities');"
          > onmouseout=MM_startTimeout(); href="../cities.html" class="sidemenutitles">US
          > Cities</a>
          > <a onmouseover="MM_showMenu(window.mm_menu_states,20,723,'States');"
          > onmouseout=MM_startTimeout(); href="../states.html" class="sidemenutitles">US
          > States</a>
          > <a onmouseover="MM_showMenu(window.mm_menu_tips,20,954,'Tips');"
          > onmouseout=MM_startTimeout(); href="../tips/index.html"
          > class="sidemenutitles">Travel Tips</a>
          >
          > The cities and states menus are defined in the destinations.js file.
          >
          > The menu items defined in the destinations.js file display fine. The menu
          > items in the california.js and tips.js files get the error message.
          >
          > Any help would be greatly appreciated! Thanks!
          >