How to change the color of a menu item?


#1

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?




#2


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


#3

Goodmorning Alexandra…
I dont quite understand your explanation.

I have:
menu.addNewSibling(“men1”, “men2”, “Alarms”, false);

I would like to change the background color of this Item programmatically

I have tried:

menu.idPull[menu.idPrefix+men2].style.color = “red”

But it gives error


#4

Please, refer to the following snippet demonstrating the logic:
http://snippet.dhtmlx.com/5/e4d01019a