Recent Questions Treemenu Magic Safari Problem
Q: Does your menu system support imbedded check boxes? I want to be able to use menus to help users select options and want to have those selections УstickФ for the duration of their session. Do you have any examples of this?
A: Yes, you can insert any html code within menuItems, for example:
["|You can place <b>any HTML code</b><br> to item, for example <u>image</u>:<br><img src=img/logo.gif>","testlink.html"],
["|Index <select style='width:120px;height:17px;font:normal 10px Tahoma,Arial;'><option>Section 1<option>Section 2<option>Section 3</select>", "", "", "", "", "", "", ""],
["|Search <input type=text style='width:80px;height:17px;font:normal 10px Tahoma,Arial;'> <input type=button value='Go' style='width:30px;height:17px;font:normal 10px Tahoma,Arial;'>", "", "", "", "", "", "", "0"],
["|Write Us", "mailto:[email protected]", ""],
Q: How change the color of the link in the dhtml vertical menu if the link is already visited.
A: JavaScript Tree Menu has only two states normal and mouseover,
butyou can highlight menu items in two ways:
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">Javascript Menu 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 menu 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.
You can find more info here:
http://www.deluxe-menu.com/highlighted-items-sample.html
Q: Is there a different type of menu, other than the way I have it set up, such as the tree type, that might load faster or take up less space when the page loads?
A: You should set
var dmAJAX=1;
create .js files with your submenus and call this files from your mainfile, for example:
var menuItems = [
["Home","testlink.htm"],
["Product Info","", , , , , , , "data-samples/data-ajax2.js", ],
["Samples","", , , , , , , "data-samples/data-ajax3.js", ],
["Purchase","testlink.htm"],
["Contact Us","testlink.htm"],
];
/*** data-ajax2.js ****/
var menuItems = [
["Features","testlink.htm"],
["Installation",""],
["Parameters Info","testlink.htm"],
["Dynamic Functions","testlink.htm"],
["Supported Browsers",""],
];
Add dmenu_ajax.js file in the same folder with your dmenu.js file.
Try that.
Q: I have a Menu called topnavbar.js when this menu is applied to a page not in a subfolder the links work. This topnavbar menu includes the following items; District Office, Cumberland Head Elementary School, Beekmantown Elementary School, Beekmantown Middle School, and Beekmantown High School.
However, if you put the topnavbar on a page that is located in a subfolder the links in the topnavbar add this subfolder name to the link. So instead of districtoffice.htm the link is transportation/districtoffice.htm and that page doesn’t exist.
A: You can use additional parameters to make menu paths absolute:
var pathPrefix_img = "http://domain.com/images/";
var pathPrefix_link = "http://domain.com/pages/";
These parameters allow to make images and links paths absolute.
For example:
var pathPrefix_img = "http://domain.com/images/";
var pathPrefix_link = "http://domain.com/pages/";
var menuItems = [
["text", "index.html", "icon1.gif", "icon2.gif"],
];
So, link path will be look so:
http://domain.com/pages/index.html
Images paths will be look so:
http://domain.com/images/icon1.gif
http://domain.com/images/icon2.gif
Please, try to use these parameters.