Recent Questions
Q: Only with IE7 (IE6 ok, firefox ok): on rollover on javascript submenu, the images don't show properly .. But, at second rollover on the same link, the image shows it correctly...
We use jquery library on the page.
Could you tell us something about?
A: Please try to change dm_writeAll param to
var dm_writeAll=1;
Q: I'm still having the issue with the sub-menus not being in the proper place, however I was able to fix the issue with menu now showing up in IE at all, it turns out I forgot a tag. So do you know why the sub-menu alignment changes depending on the browser window size? Either of the links below should give an example.
A: See, the problem is that the script can't get css properties of the object if they are described in separate .css block (or file).
In other words, you can't get the value of "position" attribute of the object if the object doesn't have this property within inline style(style="position:absolute"). To get the value you should move .css style into style="" attribute.
Please, try to add your
css file -> inline css, for example:
You should add style="position:absolute;"
to the
<DIV id=navholder>
So, you'll have:
<DIV id=navholder style="position:absolute;">
Q: I have a question:
The smHidePause = 1500
If hide is busy (during 1500), and I click somewhere else on the screen (empty place), I want the submenu to hide.
Can I make this happen?
A: Yes, you can do it.
You should use the following function to hide your submenus:
_dmsm(0);
where 0 - is index of the menu on a page >0.
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>