Recent Questions
Q: 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: Do you support keyboard shortcuts (up/down through javascript for drop down menu)? I couldn't find an example of that.
Also, this one from OpenCube (exploding submenus) runs on Firefox too. No way to get that in yours?
A: No, Deluxe Menu doesn't support transitional effect in Firefox. Thereis no way to do it in the current version of the menu. It is possiblethat we'll add this feature in the next versions.
Deluxe Menu has keyboard support. You can check it on our website
http://deluxe-menu.com/
Press Ctrl+F2 to enter/switch to next menu on the page.
Arrow keys - navigate
Esc - exit the menu
Use the following parameter to enable keystrokes support:
var keystrokes = 1;
0 - disabled (default), 1 - enabled.
Use also the following parameters:
var dm_focus = 1; Show focus selection for selected item.
var dm_actKey = 113; Key code for keystrokes activation.
Works with Ctrl key only.
Default value is 113 = F2 key, 114 = F3 key, 115 = F4 key, etc.
Q: What I mean is I still want the destination page to be static inthe var menuitems but when the javascript side menu item is clicked, it'll run a js on the onclick or mouseup event.
Is this possible?
something like:
var menuItems = [
["text", "home", "javascript:onclick=your_code_here"]
];
A: You can achieve this by using standard html objects within javascript side menu items, for example:
var menuitems = [
["<div onContextMenu='your_code_here'>item text</div>", ""]
];
Actually you can use any html code within menuItems.
Q: I fixed that problem, but if you look at the website, I have the first 2 links in the javascript sliding menu set to show up in the mainframe but nothing happens. When I open deluxe menu on my computer, it also shows that I have the third link set up to show in the mainframe too but when I upload it to the website, it acts like it's not pointing to any file/url
A: Now you have:
["Home","main.html", "", "", "", "#mainframe", "", "", "", "", "", ],
["County Departments","dept.html", "", "", "", "#mainframe", "", "", "", "", "", ],
["Board Members","", "", "", "", "mainfrm", "", "", "", "", "", ],
It is not correct to set target as "#mainframe". You should write"mainframe":
["Home","main.html", "", "", "", "mainframe", "", "", "", "", "", ],
["County Departments","dept.html", "", "", "", "mainframe", "", "", "", "", "", ],
["Board Members","", "", "", "", "mainframe", "", "", "", "", "", ],