|
|
How can I set different parameters for diferent items in my drop down menu javascript?
Return to Recent Questions
Q:
I have an horizontal drop down menu javascript in which the submenus drop down.
For the first level items (which are horizontal), I do not want item spacing
or itemPadding, that is:
var itemSpacing=0;
var itemPadding=0;
However, for the second and third level menu items, that drop down, I do
need spacing and padding, like this:
var itemSpacing=1;
var itemPadding="1px";
How can achieve this if, we have only one set of drop down menu javascript parameters?
A:
You should assign Individual Styles for the drop down menu javascript.
You should set the following parameters:
var itemSpacing = 0;
var itemPadding = "0px";
and create individual style for submenus
var menuStyles = [
["menuBackImage=images/subm_back.gif","itemSpacing=1","itemPadding=1px"], // add Spacing and Padding to the style which is used for the third level menu items.
["columnPerSubmenu=2"],
["itemSpacing=1","itemPadding=1px"], //style 2
];
You should assign this styles for the second and third level drop down menu javascript items
["DHTML Menus","", "images/icon1.gif", "images/icon1o.gif", , , , , , , , ],
["|The DHTML Menu","http://dhtml-menu.com",
"images/icon2.gif", "images/icon2o.gif", , , , "2", , , , ], // assign Style 2
["||Features","", "images/icon3.gif", , , , "0", "0", , , , ], // assign Style 0
["|||First Column","", , , , , "0", "1", , , , ],
["|||Second Column","", , , , , "0", , , , , ],
["||Cross-frame Mode","", "images/icon5.gif", "images/icon5o.gif", , , "1", , , , , ],
["||Easy Installation","", "images/icon5.gif", "images/icon5o.gif", , , "1", , , , , ],
["|The DHTML Tree","http://dhtml-menu.com/dhtml-tree/", "images/icon2.gif", "images/icon2o.gif", , , , , , , , ],
...
Return to Recent Questions
Related:
- Apr 09, 2009 - Can I set pointer that tells path to all drop down menu vertical files?
- Apr 11, 2009 - I have the menus java script somewhat in location, none of the settings are correct...
- Apr 13, 2009 - What the options of CSS parameters in the popup menu example?
- Apr 25, 2009 - The website navigation bars looks differently in IE 6 and Firefox...
- May 15, 2009 - We want to set a specific width for each top level item in the script menu
- May 24, 2009 - When set up links in the web menu design using Tuner app, it changes them to different paths.
- May 25, 2009 - How can I setup size and color of the font for individual button in the css drop down menus?
- May 30, 2009 - If the new page in the frame is a frameset itself, the javascript tree menus won't show up.
- May 31, 2009 - I set a target at '_mainFrame' for my drop down menus css but it opens in the same window.
- Jun 21, 2009 - Is there a way I can include javascript menu tree code parameters in a separate file?
- Jun 28, 2009 - I have problem with our characters of iso-8859-2 charset in the rollover menu.
|