Recent Questions Html Css Top Down Tree
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: Images don't appear in my menu.
A: Now you have two lines:
<SCRIPT type=text/javascript> var dmWorkPath = "../misyssbm.files/";</SCRIPT>
and
<SCRIPT type=text/javascript> var dmWorkPath = "../side_menu.files/";</SCRIPT>
But you should have only one line.
Please, check it.
Q: The plus symbols (+) for Home, PRODUCT CATALOG, and Back are almost non visible and I can not find a parameter to move the collapsible tree menu to the right or to put a border on the left side.
A: You set the following style:
#menu TABLE {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 1em; PADDING-BOTTOM: 0px; MARGIN: -4px; PADDING-TOP: 0px; BORDER-COLLAPSE: collapse
}
You should delete
MARGIN: -4px;
style or set it:
MARGIN: -4px -4px -4px 0px;
Q: I know this must be somewhere in your support information but I can't find it. Can you tell me something I could do for people who have Javascript turned off so they can at least use my base menu (not the submenus).
A: When your security settings in IE doesn't allow Javascript onpages you load you can't see a dynamic page content.
There is no way to enable these preferences automatically, in othercase there are no reasons to create security preferences.
Please, try to use search engine friendly code you'll see all yourlinks.
You can generate search engine friendly code.
JavaScript Tree Menu is a search engine friendly menu since v1.12.
To create a search engine friendly menu you should add additional html code within your html page:
<div id="dmlinks">
<a href="http://deluxe-menu.com">menu_item_text1</a>
<a href="http://deluxe-tree.com">menu_item_text2</a>
...etc.
To generate such a code use Deluxe Tuner application.
You can find this GUI in the trial package.
Run Tuner, load your menu and click Tools/Generate SE-friendly Code (F3).