(c) 2007, DHTML-Menu.com
 
   
   
  Support
  Recent Questions
  Write To Support
 

    Is there a way to set a parameter such that when a javascript dynamic menu Item is CLICKED...

Return to Recent Questions


Q: Is there a way to establish a setting h that when a javascript dynamic menu Item is clicked, the color of that javascript dynamic menu Item STAYS darker. Such as when you hover over the menu items, the background color of that javascript dynamic menu item changes (it becomes darker). It helps help the user know which category of the website they are visiting now.


A: The javascript dynamic menu has only two states normal and mouseover.

Try to do the following things:

- delete var pressedItem=1; parameter from your data file
- set correct parameter on each page before you call data file, for example:

<noscript><a href="http://dhtml-menu.com">javascript dynamic menu by DHTML-Menu.com</a></noscript>
<script type="text/javascript">var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<script type="text/javascript">var pressedItem=3;</script>
...
<script type="text/javascript" src="menudir/data.js"></script>

You can also set a pressed item using Javascript API:

function dm_ext_setPressedItem (menuInd, submenuInd, itemInd, recursion)

Sets a current pressed item.
menuInd - index of a menu on a page, >= 0.
submenuInd - index of a submenu, >= 0.
itemInd - index of an item, >=0.
recursion = true/false - highlight parent items.

But notice, to use dm_ext_setPressedItem() you should know ID of selected item and subitem.
You can't get this ID after you reload your page. That is why you should write your own code on PHP.





Return to Recent Questions

Related:
   
Copyright (c) 2012, DHTML-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Write Us
All rights reserved. responsive menu | top website builders | website designing software | Mobirise Themes | HTML5 Video