Recent Questions Code For Tree Tabs In Javascript
Q: I already have your product. I need to know if I can call js functions using the .js file in java menu sample.
A: You can use your own javascript functions in the menu items.
You should paste "javascript:some_function()" into item's link field, for example:
var menuItems = [
["text", "javascript:your_function(...)", ...]
];
var menuItems = [
["item text", "javascript:alert('Hello World')", , , , ,]
];
Q: Can data be loaded dynamically?
For example, can your dhtml menu source code load the child of a node once the node is clicked on?
A: You can use AJAX like technology.
http://deluxe-menu.com/ajax-technology-menu-sample.html
You may generate a menu from a database or XML using any server-side script, e.g., PHP, ASP, VB, etc.
However, these scripts don't work inside of Javascript .js files, so, you should move parameters of a menu from a .js file into an html-page, e.g.:
<!-- JavaScript Tree Menu -->
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<!-- (c) 2006, http://deluxe-menu.com -->
<script type="text/javascript" language="JavaScript1.2">
// and describe parameters of a menu
var parameter1=value1;
var parameter2=value2;
etc.
var menuItems = [
// here you generate items using server-side scripts (php, asp, vb, etc.)
];
</script>
The example of the menu working with PHP/MYSQL you can find here:
http://deluxe-menu.com/rq-loading-bar-MySQL-support.html
Q: The secondary javascript menu style sub menu under Aircraft doesn't line up the same as in Tuner..
A: JavaScript Tree Menu doesn't work correctly (incorrect submenu position) if youhave complex frame structure.
The problem is in a structure of your frameset.
Mozilla browsers can't determine absolute coordinates for a frame, so submenus drop down with an offset.
You should create, for example, the following frameset structure:
--|------------|--
| top |
--|------------|--
| menu |
--|------------|--
| |
| submenus |
| |
Now a second row has 3 columns and all browsers can determine a width of the 1st column in the second row.
Q: I was wondering if you could help me. I have recently done a site and put a menu into the site
The basic javascript menu is on the top of the screen but it has lines through each of the menus just after the words and before the arrow on each of them. I have stretched the menu out to cover the whole of the top of the page but i need to get these lines out of the menu.
Can you please help me with this problem?
A: See images in Vista Templates have the fixed width and height (92 x 21):
var itemStyles = [
["itemWidth=92px","itemHeight=21px","itemBackColor=transparent,transparent","itemBorderWidth=0","fontStyle=normal 11pxTahoma","fontColor=#3A3A3A,#000000","itemBackImage=data-vista-2-04.files/btn_olive.gif,data-vista-2-04.files/btn_white.gif"],
];
When items text is too long you can have such effect.
You can try to use combined background for your items, for example:
var beforeItemImage = [,]; //left-side image for normal and mouse over state
var itemBackImage = [,]; //background or image for normal and mouse over state
var afterItemImage = [,]; //right-side image for normal and mouse over state
var beforeItemImageW = '';
var afterItemImageW = '';
var beforeItemImageH = '';
var afterItemImageH ='';
But you should create a small images in any Graph Editor, for example:
button_n_back.gif
button_n_left.gif
button_n_right.gif
button_o_back.gif
button_o_left.gif
button_o_right.gif