Loading ...
Sorry, an error occurred while loading the content.

Newbie help with Menu

Expand Messages
  • jeffwatkins2000
    Hi I m trying to use the nested menu feature (see http://developer.yahoo.com/yui/examples/menu/example07.html) I have copied the code exactly as given in their
    Message 1 of 3 , Mar 27, 2007
    • 0 Attachment
      Hi

      I'm trying to use the nested menu feature (see

      http://developer.yahoo.com/yui/examples/menu/example07.html)

      I have copied the code exactly as given in their example (I think) but
      only the top level menu appears in the browser on my page and the sub
      menu is missing

      http://www.activemedia.ltd.uk/main.shtml

      Can anyone help with a solution please
    • foti-1@comcast.net
      It looks to me as though you re not creating the menu in the correct spot. Here s your code: //
      Message 2 of 3 , Mar 27, 2007
      • 0 Attachment
        It looks to me as though you're not creating the menu in the correct spot. Here's your code:

        <script type="text/javascript">

        //<![CDATA[
        function load() {
        if (GBrowserIsCompatible()) {
        // ... SNIP ...
        }
        }
        //]]>
        var oMenu = new YAHOO.widget.Menu("mainmenu");
        oMenu.render();
        oMenu.show();
        </script>

        Notice that the new menu is not wrapped in the load method, but is instead just being executed once the code reaches it. In this particular case, the DOM hasn't finished loading so it's probably not finding "mainmenu". Try modifying your code slightly to this:

        <script type="text/javascript">

        //<![CDATA[
        function load() {
        if (GBrowserIsCompatible()) {
        // ... SNIP ...
        }

        var oMenu = new YAHOO.widget.Menu("mainmenu");
        oMenu.render();
        oMenu.show();
        }
        //]]>
        </script>

        Hope that helps.
        Peter

        -------------- Original message ----------------------
        From: "jeffwatkins2000" <jeffwatkins2000@...>
        > Hi
        >
        > I'm trying to use the nested menu feature (see
        >
        > http://developer.yahoo.com/yui/examples/menu/example07.html)
        >
        > I have copied the code exactly as given in their example (I think) but
        > only the top level menu appears in the browser on my page and the sub
        > menu is missing
        >
        > http://www.activemedia.ltd.uk/main.shtml
        >
        > Can anyone help with a solution please
        >
        >
      • jeffwatkins2000
        Thanks Pete After a bit of fiddling found it - I m sure you were right
        Message 3 of 3 , Mar 28, 2007
        • 0 Attachment
          Thanks Pete

          After a bit of fiddling found it - I'm sure you were right
        Your message has been successfully submitted and would be delivered to recipients shortly.