|
|
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.
- 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 27, 2006 - In IE 6.0 and Firefox 1.5.0.4, the submenus of my dhtml dropdown menu are not visible
- Dec 10, 2006 - I need the cursor not to change when hovering over Menu items which don't have links
- March 28, 2007 - For some reason my item separator image will not show in javascript slide down menu
- April 05, 2007 - I would like to change the height of the submenu items in the menu tree
- June 12, 2007 - Only the first 8 items only get loaded in ajax dropdown menu.
- Aug 07, 2007 - If I use doctype the settings of the submenus in javascript dropdown menu get lost.
- Sep 13, 2007 - I want to use different background color for main items and submenus for cascading menus
- Sep 28, 2007 - How does your multiple website license for dependant dropdown menus work?
|