Results 1 to 2 of 2

Thread: JsDoMenuBar submenu?

  1. #1
    Join Date
    Sep 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JsDoMenuBar submenu?

    how can i get a submenu into the JsdoMenuBar?
    I looked on both DD and the creators site but found nothing except that DD uses a submenu, so i know it is possible just don't know how to do it. do u?

    The bar i am refering to is located here:
    http://www.dynamicdrive.com/dynamicindex1/jsdomenubar/

    thanks in advance for any help or direction.

  2. #2
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Take a look at the demo page "demo1_quirks.htm"

    Code:
    fixedMenu1 = new jsDOMenu(120, "", "fixed");
    with (fixedMenu1) {
        addMenuItem(new menuItem("Item 1", "", "blank.htm"));
        addMenuItem(new menuItem("Item 2", "", "blank.htm"));
        addMenuItem(new menuItem("Item 3", "", "blank.htm"));
        addMenuItem(new menuItem("-"));
        addMenuItem(new menuItem("Item 4", "", "blank.htm"));
        addMenuItem(new menuItem("Item 5", "item5", "blank.htm"));
      }
    It creates fixedMenu1. Look at that last line. It has "item5" variable in it.

    Code:
    fixedMenu1_1 = new jsDOMenu(130, "", "fixed");
      with (fixedMenu1_1) {
        addMenuItem(new menuItem("Item 1", "", "blank.htm"));
        addMenuItem(new menuItem("-"));
        addMenuItem(new menuItem("Item 2", "", "blank.htm"));
        addMenuItem(new menuItem("-"));
        addMenuItem(new menuItem("Item 3", "", "blank.htm"));
        addMenuItem(new menuItem("-"));
        addMenuItem(new menuItem("Item 4", "", "blank.htm"));
      }
    This code creates the sub menu for fixedMenu1

    Scroll down a little bit, You'll find :
    Code:
    fixedMenu1.items.item5.setSubMenu(fixedMenu1_1);
    This one connects fixedMenu1_1 as a sub menu of fixedMenu1. It automatically connects "Item 5" with the sub menu because it has the "item5" id on it. If You want "Item 2" instead of "Item 5", move the id to "Item 2". You can change "item5" id to, for example "submenu1", but make sure You change "item5" to "submenu1" in that last code

    Code:
    fixedMenu1 = new jsDOMenu(120, "", "fixed");
    with (fixedMenu1) {
        addMenuItem(new menuItem("Item 1", "", "blank.htm"));
        addMenuItem(new menuItem("Item 2", "submenu1", "blank.htm"));
        addMenuItem(new menuItem("Item 3", "", "blank.htm"));
        addMenuItem(new menuItem("-"));
        addMenuItem(new menuItem("Item 4", "", "blank.htm"));
        addMenuItem(new menuItem("Item 5", "", "blank.htm"));
      }
    and
    Code:
    fixedMenu1.items.submenu1.setSubMenu(fixedMenu1_1);
    Hope that helps

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •