|
|
Can you provide an example of how to dynamically change the menu items at runtime for the dropdown menus?
Return to Recent Questions
Q:
Can you provide an example of how to dynamically change the menu items at runtime for the dropdown menus?
(asp is fine, but if it needs to javascript that is also ok)
A:
1) You can use API functions to affect items dynamically:
http://deluxe-menu.com/functions-info.html
2)Generate your menu items dynamically from database.
Unfortunately we don't have working example with ASP.
You may generate a menu from a database or XML using any server-side script, e.g., PHP, ASP, VB, etc.
However, these scripts don't work inside of Javascript .js files, so,
you should move parameters of a menu from a .js file into an html-page, e.g.:
<!-- Deluxe Menu -->
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<!-- (c) 2008, http://deluxe-menu.com -->
<script type="text/javascript" language="JavaScript1.2">
// and describe parameters of a menu
var parameter1=value1;
var parameter2=value2;
etc.
var menuItems = [
// here you generate items using server-side scripts (php, asp, vb, etc.)
];
</script>
The example of the menu working with PHP/MYSQL you can find here:
http://deluxe-menu.com/rq-loading-bar-MySQL-support.html
Return to Recent Questions
Related:
- Sep 11, 2006 - If I use doctype the settings of the submenus in javascript dropdown menu get lost.
- Sep 16, 2006 - I need to be able to highlight the selected menu item of the html tree menu.
- Oct 03, 2006 - Do I have the ability to change colors for the menus and the sub menus in the cascade menu.
- Oct 07, 2006 - How do you change the back ground color of the javascript horizontal menus?
- Oct 15, 2006 - There's some problems when we use two javascript horizontal menus.
- Oct 27, 2006 - In IE 6.0 and Firefox 1.5.0.4, the submenus of my dhtml dropdown menu are not visible
- Nov 12, 2006 - Is this menu bar code compatible under Linux?
- Dec 01, 2006 - Is there any way to have a cursor in a slide menu so it only becomes a pointer for a link?
- Dec 10, 2006 - I need the cursor not to change when hovering over Menu items which don't have links
- Dec 18, 2006 - The autoscroll doesn’t seem to work with the css positioning though in menu onMouseOver.
- Jan 05, 2007 - Can html side menu support context menus on right click
|