Home arrow HTML arrow Page 2 - Building a Bulleted Menu Of Links: Display Method
HTML

Building a Bulleted Menu Of Links: Display Method


Many web pages display their links in the form of a bulleted menu. You can make such menus a bit more interesting by adding functionality to expand and contract the menu, if it makes sense to divide the menu into levels. This two-part article will show you how to do it.

Author Info:
By: Chrysanthus Forcha
Rating: 4 stars4 stars4 stars4 stars4 stars / 3
February 23, 2009
TABLE OF CONTENTS:
  1. · Building a Bulleted Menu Of Links: Display Method
  2. · Operation from the User’s Point of View
  3. · Implementation
  4. · The UL and LI elements

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Building a Bulleted Menu Of Links: Display Method - Operation from the User’s Point of View
(Page 2 of 4 )

In this section I explain how the user understands what he has to do and what is going on from his point of view. Assuming that a list item can be expanded (has a sub-list), then when the user’s mouse pointer hovers over it, a tool tip should appear indicating that he can click the corresponding bullet to expand the list item (i.e. to see a sub-list). While the item is expanded, if the mouse pointer hovers over the parent list item, a tool tip should appear indicating that he can click the corresponding bullet to collapse the list into the parent list item (i.e. remove the sub-list).

A list item that can be expanded, but is not yet expanded, has a disk-shaped bullet. When a list item is expanded, its bullet is a circle. A list item that cannot be expanded has the bullet of a square. The following figure illustrates this:


  • First Level Link 1

    • Second Level Link 11
    • Second Level Link 12

      • Third Level Link 121

      • Third Level Link 122

      • Third Level Link 123

    • Second Level Link 13

  • First Level Link 2

  • First Level Link 3


Fig.3 List items in different states.

You need basic knowledge of HTML, CSS and JavaScript in order to understand this article.

Method

In this section, I explain how it works from the technical perspective. Note that the links have been arranged in levels. Each link is in an LI element. The first level list (fig.1) is a UL element that has each First Level Link in an LI element. We can say a first level link is in a first level LI element. Fig.1 above is as follows from a technical perspective:


<ul>

<li><a>First Level Link 1</a></li>

<li><a>First Level Link 2</a></li>

<li><a>First Level Link 3</a></li>

</ul>


Below each first level LI element is a UL element with its own LI elements. This UL element will be the sub-list of the LI element above it. This description applies to further sub-lists down the chain. Technically, each of the above first level LI elements is expanded as follows (the illustration is the case of First Level Link 1):


<li><a>First Level Link 1</a></li>

<ul>

<li>Second Level Link 11</li>

<ul>

<li>Third Level Link 111</li>

<li>Third Level Link 112</li>

<li>Third Level Link 113</li>

</ul>

<li>Second Level Link 12</li>

<ul>

<li>Third Level Link 121</li>

<li>Third Level Link 122</li>

<li>Third Level Link 123</li>

</ul>

<li>Second Level Link 13</li>

<ul>

<li>Third Level Link 131</li>

<li>Third Level Link 132</li>

<li>Third Level Link 133</li>

</ul>

</ul>


Fig.4 Descendants of First Level Link 1

Whenever you see a list, it means its CSS Display property has the “block” value. When you do not see a list, it means its CSS Display property has the “none” value.

All of the lists should be in one HTML containing block e.g. a DIV element.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials