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

    How I can make the current menus using javascript item to be highlighted?

Return to Recent Questions

Q: When I stay on one page (for example "Purchase") Ólso must have the menu-point "purchase" another color or font. How can I make this with my menus using javascript?

A: Try to set pressed item.
Please, check the following parameter

var pressedItem=-2;
This parameter sets an index of an item that will be highlighted by default.
-2 - the toggle mode is disabled;
-1 - the toggle mode is enabled, but no items highlighted by default;
0,1,2,3,... - index of highlighted item in a top-menu.

DHTML Menu v3.0 saves it state after the reloading of the page.

You can set a pressed item using Javascript API:

function dm_ext_setPressedItem (menuInd, submenuInd, itemInd, recursion)

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

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 server side script.
You can also set the correct
var pressedItem=1;
parameter on each html page.

Return to Recent Questions

Copyright (c) 2012, DHTML-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Write Us
All rights reserved. responsive menu | icon font | bootstrap popup window | bootstrap modal popup | banner slider