Recent Questions Jsf Javascript Tree Menu
Q: I now wish to dynamically change the drop down menu in html parameters. For this, I have set the following parameters:
// Dynamic Menu
var dynamic=1;
1.Please send me the reference link for the dynamic menu commands available (for javascript).
2.Now AFTER initialization, dm_init();, I wish to change the default var itemTarget="Sub_Main";
How do I do that??
A: You can find more info about API functions here:
http://deluxe-menu.com/functions-info.html
Unfortunately it is not possible to change drop down menu in html parameters ( var ...)after menu initialization.
So, there is no way to change
var itemTarget="Sub_Main";
But you can change target for each item individually (targetparameter in menuItems) using dm_ext_changeItem function.
var menuItems = [
[text, link, iconNormal, iconOver, tip, target, itemStyleInd, submenuStyleInd, jsFilename],
[text, link, iconNormal, iconOver, tip, target, itemStyleInd, submenuStyleInd, jsFilename],
...
];
Q: I need the links for the side navigation bar to be vertical
and the pop up to come up on the right, rather than the bottom.
Is thispossible?
A: You should use the following parameters:
var isHorizontal=0;
var subMenuAlign="right";
Q: I am trying to get my submenu to be all black along with the main menu item that I am hovering over.
But I cannot do it.
A: Now you have
["|About Us","About_Us", , , ,"Tip Text" , , , ,"0"],
it is not right. You should write
["|About Us","About_Us", , ,"Tip Text", , ,"0",],
Q: Greetings. How do I make a menu item as default selected and open when the page loads with the dhtml menu bar script? Thanks.
A: JavaScript Tree Menu has only two states normal and mouseover.
Try to do the following things:
- delete var pressedItem=1; parameter from your data file
- set correct parameter on each page before you call data file, forexample:
<noscript><a href="http://deluxe-menu.com">dhtml menu bar script by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<script type="text/javascript"> var pressedItem=3;</script>
...
<script type="text/javascript" src="menudir/data.js"></script>
You can also set a pressed item using Javascript API:
function dm_ext_setPressedItem (menuInd, submenuInd, itemInd, recursion)
Sets a current pressed item.
menuInd - index of a dhtml menu bar script on a page, >= 0.
submenuInd - index of a submenu, >= 0.
itemInd - index of an item, >=0.
recursion = true/false - highlight parent items.
But notice, to use dm_ext_setPressedItem() you should know ID of selected item and subitem. You can't get this ID after you reload your page. That is why you should write your own code on PHP.