onMouseOver event for dhtmlxmenu

I need to add onmouseover to dhtmlxmenu but there is no public method. I want to make small explanations and this explanations has to be change when the mouse cursor over another item. This event has to work for both items top level or sublevel
Thanks in advance.

There are not onmouseover and onmouseout events. However, you may set own event listeners for html object of each item:

menu.forEachItem(function(id){ /*html object of an item*/ var obj = menu.idPull[menu.idPrefix+id]; if(obj){ /*settings event listeners*/ dhtmlxEvent(obj,"mouseover",function(){ yourFunction1(id) }) dhtmlxEvent(obj,"mouseout",function(){ yourFunction2(id) }) } });

I want to write id of mouseovered menu item inside a div as below but couldn’t success. What is the problem?
Thanks in advance.

menu.forEachItem(function(id){
/html object of an item/
var obj = menu.idPull[menu.idPrefix+id];
if(obj){
/settings event listeners/
dhtmlxEvent(obj,“mouseover”,function(){
document.getElementById(‘divCollar’).innerHTML=id;
})
dhtmlxEvent(obj,“mouseout”,function(){
})
}
});

Make sure that you called forEachItem method after items are loaded.

If you are using xml loading, you need to do the following:

menu.loadXML(url,function(){
menu.forEachItem(function(id){
/html object of an item/
var obj = menu.idPull[menu.idPrefix+id];
if(obj){
/settings event listeners/
dhtmlxEvent(obj,“mouseover”,function(){
document.getElementById(‘divCollar’).innerHTML=id;
})
dhtmlxEvent(obj,“mouseout”,function(){
})
}
});
})

thank you very much, it works