SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Aug 2007
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    3 Levels Javascript Tree Menu

    HI,guys! I would like to create a 3 level javascript tree menu.
    Here are the first level menu items.

    HTML Code:
    var myTree = new Tree ("myFolder");
    myTree.addTreeItem("f1");
    myTree.addTreeItem("f2");
    myTree.addTreeItem("f3");
    myTree.addTreeItem("f4");
    myTree.addTreeItem("f5");
    myTree.addTreeItem("f6");
    myTree.addTreeItem("f7");
    How can I use addTreeItem() to add menu items up to 3rd level from each
    1st level items?
    I need to corporate with some icons as well if item is clicked,for example the hierachical line and +/- are displayed which similiar with xml menu.

    Thanks...

  2. #2
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey devil_vin,
    The object Tree is not inbuilt object of Java script so not sure what are the capabilities does it have.
    try this

    var myTree = new Tree ("myFolder");
    myTree.addTreeItem("f1");
    var myTreeNew = new Tree ("Test");
    myTreeNew.addTreeItem("Link1");
    myTree.addTreeItem(myTreeNew);

    Mostly this will fails as i am not sure if the Tree object supports this kind of object addition. But its always better to try and fail rather than not trying and failing
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.


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
  •