Recent Questions
Q: We have been using a free javascript for a couple of years but now we would like to have a functionality that our existing js is missing.
Basically, we need the ordinary tree view javascript with "+" and "-" that highlights the node clicked. No problem with that I suppose... BUT, we have a bunch of pages with internal links, linking the visitor to other pages within the site (i.e. they don't have to use the leftside tree navigation). What I want is that the navigation js recognizes that a page loads without any node has been clicked, and automagically expands the nav tree and highlights the node for that page.
No AJAX, no XML, no php or asp, just plain HTML + JS is a requirement from our customers.
Is that possible with any of your products...?
A: Yes it is possible with Deluxe Tree.
Find more info here:
http://deluxe-tree.com/highlight-selected-menu-item-sample.htmlQ: I’d like to know how to populate the navigation bar menu from a database?
A: Please, see the example of .php file.The content of .php file depends on your database structure.
<?php
// The example for PHP/MySQL.
// MySQL database has the table "menuTable" that contains data for menu items.
// The table has the following fields:
// 1. "text" - item text
// 2. "link" - item link
// 3. "icon1" - item icon (normal state)
// 4. "icon2" - item icon (mouseover state)
function getMenuItems()
{
$jsItems = '';
// Select all records from table "menuTable"
$allItems = mysql_query('SELECT * FROM menuTable;');
// Extract items data from database and build Javascript code for menuItems
while ($itemData=mysql_fetch_array($allItems))
{
$jsItems .= '["'.$itemData['text'].'", "'.$itemData['link'].'", "'.$itemData['icon1'].'", "'.$itemData['icon2'].'"],';
}
// Return Javascript code
return $jsItems;
}
?>
<script>
var menuParam1 = value1;
var menuParam2 = value2;
var menuParam2 = value2;
...
var menuItems = [
// Write Javascript code for menu items
echo getMenuItems();
?>
];
</script> Q: I can not however find the option to move submenus closer together, I have too much ident for my taste.
How can I change that, by hand if that is the only way...
I mean this:
MENU1
+ SUBMENU1
I would like
MENU1
+ SUBMENU1
Is that possible?
A: If you don't want to have icons before item text you can write so:
//------- Icons -------
var ticonWidth = 0;
var ticonHeight = 0;
var ticonAlign = "left";
Your items will be closer to the "+" buttons.
Q: I'm currently experimenting with your script which I far more performant than any of the other I have tried so far, so we will probably go with yours and get a distributer license.
I do have a problem though...
I have two menus on my site.
Unfortunately, as they are being used, if you go over the first item in the left menu, it will show its submenu at the top; if you go over the first item of the top menu, it will also show the contents of the second menu...
How can we change this?
A: Installation of your menu is not correct.
See more info about installation here:
http://deluxe-menu.com/installation-info.html
There is no
<script type="text/javascript"> var dmWorkPath = "menudir/";</script>
parameter on your page.
Notice also that you should call dmenu.js file only once and then callyour data files.
Now you have two calls of dmenu.js file.