Please Note:
HierMenus is protected by copyright laws. Use of the HierMenus code requires a paid licensing agreement.
Click Here to Register

Site Navigation
Bulletins
About
Documentation
FAQ
Samples
Known Issues
Technology Jobs

internet.commerce

Partner With Us
Best Price
Mobile CRM
Calling Cards
Holiday Gift Ideas
Online Shopping
Logo Design Custom
Laptops
Remote Online Backup
Promos and Premiums
Server Racks
SMS Mobile Messaging
GPS
Compare Prices
Hurricane Shutters

          
internet.com

IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 
HierMenusCentral Enhance the Functionality of Your Web Site with DHTML HierMenus.
    

home / faq / faq 4

Frequently Asked Question #4

Question: 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 HierMenus?

Answer: Menu items can accept HTML to help format the display, which means you can include within your menu items HTML tags to present the elements the way you want them to. Your use of HTML isn't unlimited; but simple HTML formatting will usually work properly. See FAQ #2 for an example of this.

We can, therefore, include the <hr> tag in our menu item DisplayText, creating a separator:

HM_f_SetItems(
 {MenuID:"hm_m1",DisplayText:"3-D Animation",LinkURL:"http://www.webreference.com/3d/"},
 {MenuID:"hm_m1",DisplayText:"Design",LinkURL:"http://www.webreference.com/dlab/"},
 {MenuID:"hm_m1",DisplayText:"<hr size='1' />",IsRollover:0,IsGroupSeparator:1},
 {MenuID:"hm_m1",DisplayText:"DHTML",LinkURL:"http://www.webreference.com/dhtml/"}
);

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 IsRollover parameter.

Note also that we added the IsGroupSeparator parameter to the separator item. For variable width menus, adding the IsGroupSeparator directive can help to avoid mis-sizing the separator horizontally. IsGroupSeparator will have no noticeable effect on fixed width menus.

You can also create a separator by including it within an item:

HM_f_SetItems(
 {MenuID:"hm_m1",DisplayText:"3-D Animation",LinkURL:"http://www.webreference.com/3d/"},
 {MenuID:"hm_m1",DisplayText:"Design<hr size='1' />",LinkURL:"http://www.webreference.com/dlab/"},
 {MenuID:"hm_m1",DisplayText:"DHTML",LinkURL:"http://www.webreference.com/dhtml/"}
);

or

HM_f_SetItems(
 {MenuID:"hm_m1",DisplayText:"3-D Animation",LinkURL:"http://www.webreference.com/3d/"},
 {MenuID:"hm_m1",DisplayText:"Design",LinkURL:"http://www.webreference.com/dlab/"},
 {MenuID:"hm_m1",DisplayText:"<hr size='1' />DHTML",LinkURL:"http://www.webreference.com/dhtml/"}
);

But the resulting rollover effect (the separator will be included as part of the rollover) may be undesirable.

Beginning with HierMenus version 6, you can also create separators by way of the SeparatorSize, SeparatorStyle, and SeparatorColor parameters. Since these can now be applied on an item by item basis, you can set up your separators such that they only appear where you want them to. Here's the same example as above, only using the native HierMenus separators to accomplish a similar effect:

HM_f_SetMenus({MenuID:"hm_m1",SeparatorSize:0,SeparatorColor:"maroon"});
HM_f_SetItems(
 {MenuID:"hm_m1",DisplayText:"3-D Animation",LinkURL:"http://www.webreference.com/3d/"},
 {MenuID:"hm_m1",DisplayText:"Design", 
  LinkURL:"http://www.webreference.com/dlab/",
  SeparatorSize:1},
 {MenuID:"hm_m1",DisplayText:"DHTML",LinkURL:"http://www.webreference.com/dhtml/"}
);

Notice that we first set the default SeparatorSize/Color on the menu itself to 0, so that no separators will appear between the remaining items in the menu. Then we add the one separator we want into the Design menu item. When applied directly to items in this manner, the Separator parameters apply to the separator that appear below the item (in vertical menus) or to the right of the item (in horizontal menus).



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
Created: 3/25/2004
Updated: 3/25/2004
URL: http://www.hiermenuscentral.com/documentation/faq/faq4.html