Recent Questions
Q: I need a dhtml drop down menu with a transparent background for the menu and the submenues.
How can I define this.
A: You can set the following parameters:
var menuBackColor="transparent";
var itemBackColor=["transparent","transparent"];
You can set transparency for submenus using the following parameter:
var transparency="70";
Q: Is there any way to call a javascript function on mouseover from a menu item for a sub navigation bar?
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')", , , , ,]
];
Unfortunately, you can't assign onmouseover/onClick event to each item. However, you can achieve this by using standard html objects within items, for example:
var menuitems = [
["item text
", "index.html"]
];
Q: Is there anyway to embed particular fonts that I want to use with the javascript menu component?
A: See, for example you want to use HelveticaNeue Condensed font.
If there will be no HelveticaNeue Condensed font on the user machinethe font won't be shown correctly.
You can find another font similar to your font and write it through a comma.
You should choose the font among the following fonts:
Arial
Tahoma
Times New Roman
Trebuchet MS
Verdana
These fonts are installed on the most of windows computers.
Or you can create images with text and use it for the top items.
Q: I need to work it with PHP/MySQL. I have found some information on it in your Support section, but have problems to understand and wonder if you have more information or a working sample of the loading bar with PHP/ MySQL.
A: Info about generating menu (menu items )from a database, please, see:
http://deluxe-menu.com/generate-menu-from-database-xml-php-asp-vb-support.html
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 = [
<?php
// Write Javascript code for menu items
echo getMenuItems();
?>
];
</script>