(c) 2007, DHTML-Menu.com
 
   
   
  Support
  Recent Questions
  Write To Support
 

    How would I get the index of the item in the tree menu in javascript?

Return to Recent Questions


Q: > You should call the following function:
> dtreet_ext_getItemIDByIndex (0, 12)
> where 12 - is index of the item.

How would I know that 12 is the index of the item? How is itemInd different from its itemID? I don't understand ! I think the menuInd is always 0 for the first menu (or only in my case) tree menu in javascript menu on a page?


A: Yes, menuInd is the number of the tree menu in javascript on your page (in your case menuInd=0).

itemInd is the number of the item in your menuItems, for example:

var tmenuItems =
[
["Home", "http://dhtml-menu.com/dhtml-tree/", "icon1_t.gif", "icon1_to.gif","", "Home Page Tip","_blank"],//itemInd=0

["<img src='data_files/images/sep.gif' width=113 height=1>"],//itemInd=1

["+What's New<br><span id='letter'>This is pretty cool. I need to buy this DHTML Menu</span>", "", "icon2_t.gif", "icon2_to.gif", "", "Product Info Tip"],//itemInd=2
["|What's New", "testlink.htm", ""], //itemInd=3
["|Features", "testlink.htm", ""], //itemInd=4
["|Installation", "testlink.htm", ""], //itemInd=5
["|Functions", "testlink.htm", ""], //itemInd=6
["|Supported Browsers", "testlink.htm", ""], //itemInd=7
["Samples", "", "icon3_t.gif", "icon3_to.gif", "", "Samples Tip"], //itemInd=8
["|Sample 1", "testlink.htm", ""], //itemInd=9
["|Sample 2", "testlink.htm", ""], //itemInd=10
["|Sample 3", "", ""], //itemInd=11
["||New Sample 1", "testlink.htm", ""],//itemInd=12
["||New Sample 2", "testlink.htm", ""],//itemInd=13






Return to Recent Questions

   
Copyright (c) 2012, DHTML-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Write Us
All rights reserved. criador de site gratis | website maker | best web design software | bootstrap modal popup | CSS Slider