Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Niki on Feb 17, 2009 05:37
open dhtmlx forum
How to change the color of a menu item?

I have a menu item "Refresh". In some situations I want to show on users that "Refresh" should be pressed.
This can be done if I change:
- Text color
- Background color
- Image

Is it possible to change the color of a menu item with JavaScript?

Answer posted by Alex (support) on Feb 17, 2009 08:50

The setItemImage(id, img, imgDis) allows to set new image for a item.

But there is no API to set style. You can try to use internal method as follows:

objMenu.idPull[objMenu.idPrefix+itemId].style.color = some_colour;

Where itemId is the id of the item