Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Anna on Jan 15, 2008 08:55
open dhtmlx forum
Loading a Vertical Menu via Script

I apologize if this question is too basic. I am trying to build a veritcal-style menu and I can't figure out the syntax for doing so. All I get is a blank grey box.

<link rel="STYLESHEET" type="text/css" href="/js/dhtml/css/dhtmlxmenu.css">
<script language="JavaScript" src="/js/dhtml/dhtmlxprotobar.js"></script>
<script language="JavaScript" src="/js/dhtml/dhtmlxmenubar.js"></script>
<script language="JavaScript" src="/js/dhtml/dhtmlxcommon.js"></script>

<div id="menu_zone" style="width:100;"/></div>

aMenuBar=new dhtmlXMenuBarObject('menu_zone',120,200,"",1);
aMenuBar.setGfxPath("/js/dhtml/imgs/");        
var item = new dhtmlXMenuItemObject("file_id","File",120,"green.gif","");
aMenuBar.addItem(aMenuBar,item);
aMenuBar.showBar();

Thanks in advance.

(Using pro v15)
Answer posted by Support on Jan 15, 2008 09:49
Menu is oriented on loading from XML , so building it by script may be a complex process.

For creating vertical menu you need to add next command


aMenuBar=new dhtmlXMenuBarObject('menu_zone',120,200,"",1);
aMenuBar.setMenuMode("popup"); //<<<added
aMenuBar.setGfxPath("/js/dhtml/imgs/");        
var item = new dhtmlXMenuItemObject("file_id","File",120,"green.gif","");
aMenuBar.addItem(aMenuBar,item);
aMenuBar.showBar();