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

Re: Menu in document flow

Expand Messages
  • rootstones
    Thank you very much, now I understand the difference between the element id used in the constructor and the one in the render method. That was where I made the
    Message 1 of 3 , Sep 29, 2006
    • 0 Attachment
      Thank you very much, now I understand the difference between the
      element id used in the constructor and the one in the render method.
      That was where I made the error. All works now, thank you!


      --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@...> wrote:
      >
      > "rootstones" -
      >
      > If you are building your menu bar completely from script, the id
      that you pass to the MenuBar constructor is the id of the element that
      you want to create. When you call the "render" method, you'll pass in
      the and id or element reference for a node that the menu bar should be
      appended into. The problem with your code appears to be that you are
      passing the same id to both the MenuBar constructor and the call to
      "render." Lastly, MenuBar is positioned statically by default, so
      there is no need for you to pass that configuration into the
      constructor. Your code should look something like this:
      >
      > var oMenuBar = new YAHOO.widget.MenuBar( [ the element id for your
      menu's root node ] );
      >
      > oMenuBar.addItem("one");
      > oMenuBar.addItem("one");
      > oMenuBar.addItem("one");
      >
      > oMenuBar.render( [ the id of the element your menu should be
      rendered into ] )
      >
      > I hope that helps you.
      >
      > You might also want to take a look at the examples that use MenuBar:
      >
      > http://developer.yahoo.com/yui/examples/menu/applicationmenubar.html
      > http://developer.yahoo.com/yui/examples/menu/topnavfromjs.html
      > http://developer.yahoo.com/yui/examples/menu/topnavfromjs.html
      >
      >
      > - Todd
    Your message has been successfully submitted and would be delivered to recipients shortly.