Recent Questions
Q: Is it possible set a menu item to pressed when a page is loaded when you have multiple drop down menus on the page?
I have 2 menus side by side and I was able to set the pressed item with the JavaScript API as described in your FAQs but when I try to show an item as pressed in a second menu on the same page, the corresponding item in the first menu shows as pressed. Is there a different function that I can use for this or a way to reset the menu ID in the second menu to start from where the first menu left off so I can use the same function?
A: See the first parameter in
dm_ext_setPressedItem (menuInd, submenuInd, itemInd, recursion)
function is index of the menu.
So, if you use several menus on the one page you should use differentmenuInd parameter.
For example you have:
<script type="text/javascript" src="menu/data1.js"></script> //menuInd=0
...
<script type="text/javascript" src="menu/data2.js"></script> //menuInd=1
...
<script type="text/javascript" src="menu/data3.js"></script> //menuInd=2
...
<script type="text/javascript" src="menu/data4.js"></script> //menuInd=3
So, for the second menu you should write:
dm_ext_setPressedItem (1, 2, 5)
Q: The arrows on my cross browser javascript menu only show on the main page of my website (www.domain.com). I read the FAQs and the problem seems common and related to a path error. My path appears correct (to me anyway..lol) but it still doesn't work.
A: Try to use absolute path to your images. Set the following parameter:
var pathPrefix_img="http://www.domain.com/";
Q: Typically in order to generate a menu with multiple layers I’d put a pipe character in front of the menu text.. For example:
["|Page Admin","/admin/handoutadmin.php", , , , "_new", , , , ],
["||Student Pages","/admin/handoutadmin.php?type=1", , , , "_new", , , , ],
["||Teacher Pages","/admin/handoutadmin.php?type=2", , , , "_new", , , , ],
["||Family Letters","/admin/handoutadmin.php?type=4", , , , "_new", , , , ],
["||Transparencies","/admin/handoutadmin.php?type=3", , , , "_new", , , , ],
However, when I try to do it with dm_ext_addItem it actually SHOWS the pipe character and doesn’t create any menu levels at all.
For example:
dm_ext_addItem(0, 0, ["Add a Handout to this Lesson", "", "", "", "", "", ""]);
dm_ext_addItem(0, 0, ["|Student Page","/admin/handoutadmin.php?type=$type", "", "", "", "_new", ""]);
dm_ext_addItem(0, 0, ["|Teacher Page","/admin/handoutadmin.php?type=$type", "", "", "", "_new", ""]);
How can I generate multiple levels of the menu with javascript?
A: I suppose that your code is not valid
dm_ext_addItem(0, 0, ["|Teacher Page", "/admin/handoutadmin.php?type=$type", "", "", "", "_new", ""]);
Try to write it in the following way:
dm_ext_addItem(0, 0, ["|Teacher Page", "/admin/handoutadmin.php?type=", "", "", "", "_new", ""]);
Q: I can't seem to figure out how to specify the width of individual javascript pulldown menu items. I would like to specify that each menu item on the horizontal take up just 113px regardless of the number of characters in the item. Is there a way of doing that?
A: You should use var itemStyles to set an individual item style. Forexample:
var itemStyles = [
["itemWidth=113px"]
];
var menuItems = [
["text 1", "link", "icon1", "icon2", "tip", "target", "0"],
["text 2", "link", "icon1", "icon2", "tip", "target", "0"],
["text 3", "link", "icon1", "icon2", "tip", "target", "0"],
];
Where "0" - style number in itemStyles that contains the parametersfor items width.
Use Deluxe Tuner GUI to create and assign individual styles.