The standard method of operation for a Web site menu, including Sothink DHTML Menu, is to open a submenu onMouseOver and close it onMouseOut. Sothink DHTML Menu also provides an option to open a submenu onClick.

A request was posted on the DHTML Menu forum to have an option to close a submenu onClick, in addition to opening a submenu onClick. The programmers at Sothink Software developed a solution. To create a menu that allows submenus to be closed by clicking anywhere on a page, highlight the first menu item in the tree ("Products" in the menu above) and go to Menu Item > Condition. For Prefix enter:

var i=

and for Suffix: enter:

var m=i.oParMenu;
function stcls()
{
if(!m.bOver)
var p=m.aPopups[0];
p.fbHideX(0,p.iDepth,0,1)
for(var i=0;i<p.aItems.length;i++)
{
if(p.aItems[i].instanceOf(_STNS.UI.CUIItem))
{
p.aItems[i].fbUpDate(p.aItems[i].iStat & (_STNS.UI.CUIItem.MAXSTATE - _STNS.UI.CUIItem.MOUSEOVER_STYLE));
}
}
}
document.onclick=stcls;

If you want submenus that open onClick, be sure to check that option under Global - General, as in the following example:

openOnClick

 


Close