DHTML Lab: HierMenus CENTRAL: FAQ #4 - dhtmlab.com | WebReference

DHTML Lab: HierMenus CENTRAL: FAQ #4 - dhtmlab.com

Frequently Asked Question #4

Most OS menus have separators. That is, horizontal bars that can be used to divide the menu items into logical sections. How can I include separators using the Heirarchical Menus script?

Menu items can accept HTML to help format the display. See FAQ#2 for an example of this.

We can, therefore, include the <HR> tag, in our array element, creating a separator:


HMArray1_1 = [
    [],
    ["3-D Animation","https://www.webreference.com/3d/",1,0,0],
    ["Design","https://www.webreference.com/dlab/",1,0,0],
    ["<HR SIZE=1>","",1,0,0],            // 
    ["DHTML","https://www.webreference.com/dhtml/",1,0,0],
    ["JavaScript","https://www.webreference.com/js/",1,0,0]
]

If you choose to create a separator in this way, you are including it as a new menu item, albeit a static one. It will have the same rollover behavior as all other items, unless you exclude it from rolling over using the item_is_rollover parameter.
You can also create a separator by including it within an item:

HMArray1_1 = [
    ["3-D Animation","https://www.webreference.com/3d/",1,0,0],
    ["Design<HR SIZE=1>","https://www.webreference.com/dlab/",1,0,0],
    ["DHTML","https://www.webreference.com/dhtml/",1,0,0],
    ["JavaScript","https://www.webreference.com/js/"1,0,0]
]

or

HMArray1_1 = [
    ["3-D Animation","https://www.webreference.com/3d/",1,0,0],
    ["Design","https://www.webreference.com/dlab/",0,
    ["<HR SIZE=1>DHTML","https://www.webreference.com/dhtml/",1,0,0],
    ["JavaScript","https://www.webreference.com/js/",1,0,0],
]

NOTE:

If you choose to create separators in this way, don't forget that the regular HM_SeparatorSize parameter variable, that creates separators between all menu items, must be 0, since you are now creating your own separators manually.

HM_GL_SeparatorSize / HM_PG_SeparatorSize = 0;

Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: June 26, 2001
Revised: June 26, 2001

URL: https://www.webreference.com/dhtml/hiermenus/faq/faq4.html

Justtechjobs.comFind a programming school near you






Online Campus Both