loadFromHTML() method loads content from HTML object to the menu. First, the user should create this HTML object. For example:
<body>
<div id="menuData" style="display: none;">
<div id="m1" text="File"> // the first top menu item
<div id="m11" text="New"><hotkey>Ctrl+N</hotkey></div> //the first child item
<div id="ms1" type="separator"></div> // a separator
<div id="m12" text="Open"><hotkey>Ctrl+O</hotkey></div> //the second child item
</div>
</div>
</body>
Then loadFromHTML() should be applied with the following parameters:
myMenu.loadFromHTML("menuData", true, function(){
alert("Menu was loaded from HTML Object.");
});
Back to top