Is it possible set a pressed utem when you have multiple drop down menus on the page?
Return to 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 different
menuInd 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)
Return to Recent Questions
Related:
- Sep 02, 2006 - Little vertical spacers between menu items in the drop down menu.
- Sep 06, 2006 - The alighment of the dropdown menu is off to the right in Firefox...
- Sep 06, 2006 - The first item of the html drop down menu stays highlighted.
- Sep 11, 2006 - How can I hide my dropdown menu on print?
- Sep 11, 2006 - If I use doctype the settings of the submenus in javascript dropdown menu get lost.
- Sep 23, 2006 - Is it possible that javascript drop down menus doesn't put anything on the local computer?
- Sep 26, 2006 - Firefox doesn't support the dropshadow and effects in the javascript pull down menu.
- Sep 29, 2006 - Is it possible to use an external file in the java drop down menu?
- Oct 01, 2006 - When I click on link of my vertical drop down menu no file is loaded!?
- Oct 27, 2006 - In IE 6.0 and Firefox 1.5.0.4, the submenus of my dhtml dropdown menu are not visible
- Oct 31, 2006 - Java script executes when the link is clicked it is not the html drop down link itself.
|