WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 xmenu: toObject() function, Arnaud, August 1, 2003
     Re:xmenu: toObject() function, Erik Arvidsson, August 5, 2003

Subject: xmenu: toObject() function From: Arnaud Date: August 1, 2003

Hi Erik,

I want to had a toObject() function to get an object instead of a string.

WebFXMenuBar.prototype.toObject = function () {
 var str = "<div id='" + this.id + "' class='webfx-menu-bar'></div>";
 var obj = document.createElement(str);
 str = "";
 // loop through all menuButtons
 for (var i = 0; i < this._menuItems.length; i++)
  str += this._menuItems[i];

 obj.innerHTML = str;
 return obj; 

But I missed a point: in your toString function there's a second loop,

 for (var i = 0; i < this._subMenus.length; i++)
  str += this._subMenus[i];

and I don't understand the meaning of the subMenus for the MenuBar object.

Could you please explain?



Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.

View All Messages
Back to WebFX