Recent Questions Save Tree State Javascript
Q: I'd like to create a tabbed menu which has about 9 or 10 main tabs.
I'd like to conserve the horizontal space, and wrap the menu after 4 or 5 tabs to have two rows of main tabs. Some tabs have sub menus, some don't.
The first main tab has about 10 items, and I'd like the user to be able to click on that main tab to see the 10 items.
I was going along splendidly with tab mode on. Then I get too far to the right and want to wrap.
hence that is why I want two rows, and apparently need to add the $ to wrap the menu around to a second row.
Do I need to use two tab menus to accomplish this?
A: This doesn't work in TabMode=1.
I suppose that it will be better to use two menus on the page.
Q: I just need to know if there is a way of establishing the width at "runtime" in the javascript dynamic menu so that my frame in my frameset can be widened accordingly.
A: There are no special parameters for menu dimensions.
But you can use submenu IDs. For example, top-menu has ID"dmXXXm0"
Where XXX - menu index. So, first menu on the page has ID "dm0m0".
So, you can determine menu dimensions so:
document.getElementById('dm0m0').offsetWidth
document.getElementById('dm0m0').offsetHeight
You can also use Javascript API functions to take submenu IDs.
Q: Extremely new at this and likely way over my head…..but why when I attempt to use my own button image in the “itemBack Image” selection under “Edit Individual Styles” does it keep showing up blank in the preview screen?
A: Please, check all your paths.
You can also 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.
Q: For the attributes that can have top, left, right, bottom, i.e. border, padding, is there any way to specify just one of them in the javascript context menu? i.e. border-left: 2px. I tried 2px 0 0 0 but that doesn't seem to work.
A: You can set different border width , forexample:
var itemBorderWidth="1 0 2 5";
var itemBorderWidth="top right bottom left";