Recent Questions Smarty Treeview
Q: Hello. I have noticed that when you expand a menu and then click to another page, the menu is collapsed on the next page. I read about "state saving" and tried the parameter which did not work. Is there a way to accomplish this?
A: You can see the example for state saving here:
http://dhtml-menu.com/tree-examples/tree-menuxp-save-state.html
This menu saves its state.
To enable this mode you should include dtree_ss.js file intoyour html page and set the following parameter:
var tsaveState = 1;
See, if you open pages (with menus) from different folder itmeans that you open different menus. So, when you change a state, forexample, of the first menu within "content/" folder and then openanother page with the menu within "content/subfolder/", browsers looks for anothercookie file and can't find it and the second menu stays in a defaultstate. Is it clear?
Q: How do I add padding around a top item in the javascript menu buttons?
A: You should specify itemPadding parameter in "px".
You shouldadd "px" in your style for subitems:
var menuStyles = [
["menuBackColor=#F2F3F2","menuBorderWidth=0","itemSpacing=1","itemPadding=4px","smOrientation=undefined"],
];
Notice also that you can set multiple value for itemPadding parameter,for example:
itemPadding=4px 10px 4px 10px// top right bottom left
Q: What the options of CSS Submenu, CSS Item, and CSS Text each handle.
What are the differences in the application?
A: var cssSubmenu is a CSS class name for all submenus. You can set, forexample, background color, background image, borders for all submenus.
var cssItem is CSS class names for all items (normal state, mouseoverstate) in the top menu and submenus.
var cssItemText is CSS class names for text of all items (normalstate, mouseover state) in the top menu and submenus.
It's possible to appoint individual CSS styles for separate elements of the menu using individual item styles and individual submenu styles.
I sent you an example with css. Please, see how you can use css in themenu.
Q: When I use API like <script>dm_ext_deleteItem(0, 0, 0);</script> it works fine in my first dhtml drop down menu code (menu.js) but I'm unable to reach second one (menu_gauche.js). I’ve tried this : <script>dm_ext_deleteItem(1, 0, 0);</script> and the page came’s out with a JavaScript error on that line. I’ve read on your side about dm_ext_deleteItem api and the first parameter is for menu Id … If there anything that I have forgot ??
A: You cannot use the following function for the tree menu:
dm_ext_deleteItem(1, 0, 0);
There is no such function there:
You should use
dtreet_ext_deleteItem (0, 0)
for the tree menu, see more info:
http://deluxe-tree.com/functions-info.html
You should set menuInd=0 if you have only one dhtml drop down menu code on your page.