Home arrow HTML arrow Page 4 - 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 - The UL and LI elements
(Page 4 of 4 )

The following is what you have for the UL and LI elements for fig. 2. Go through it, noting that all the UL elements have the CSS property “display:none” except the first, which has “display:block” by default. This default property does not have to be typed. Also note the IDs and the way they have been given. Each LI element has an onclick attribute.

<div>

<ul style="list-style-type: disc">

<li onclick="splitID('LI_1')" id="LI_1" title="Click Bullet to Expand"><a href="www.somePage1.com">First Level Link 1</a></li>

<ul id="UL_11" style="display:none">

<li onclick="splitID('LI_11')" id="LI_11" title="Click Bullet to Expand"><a href="www.somePage11.com">Second Level Link 11</a></li>

<ul id="UL_111" style="display:none">

<li onclick="timesToIgnore = 2" id=""><a href="www.somePage111.com">Third Level Link111</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage112.com">Third Level Link112</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage113.com">Third Level Link113</a></li>

</ul>

<li onclick="splitID('LI_12')" id="LI_12" title="Click Bullet to Expand"><a href="www.somePage1.com">Second Level Link 12</a></li>

<ul id="UL_121" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage121.com">Third Level Link121</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage122.com">Third Level Link122</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage123.com">Third Level Link123</a></li>

</ul>

<li onclick="splitID('LI_13')" id="LI_13" title="Click Bullet to Expand"><a href="www.somePage13.com">Second Level Link 13</a></li>

<ul id="UL_131" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage131.com">Third Level Link131</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage132.com">Third Level Link132</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage133.com">Third Level Link133</a></li>

</ul>

</ul>

<li onclick="splitID('LI_2')" id="LI_2" title="Click Bullet to Expand"><a href="www.somePage2.com">First Level Link 2</a></li>

<ul id="UL_21" style="display:none">

<li onclick="splitID('LI_21')" id="LI_21" title="Click Bullet to Expand"><a href="www.somePage1.com">Second Level Link 21</a></li>

<ul id="UL_211" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage211.com">Third Level Link211</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage212.com">Third Level Link212</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage213.com">Third Level Link213</a></li>

</ul>

<li onclick="splitID('LI_22')" id="LI_22" title="Click Bullet to Expand"><a href="www.somePage1.com">Second Level Link 22</a></li>

<ul id="UL_221" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage221.com">Third Level Link221</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage222.com">Third Level Link222</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage223.com">Third Level Link223</a></li>

</ul>

<li onclick="splitID('LI_23')" id="LI_23" title="Click Bullet to Expand"><a href="www.somePage1.com">Second Level Link 23</a></li>

<ul id="UL_231" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage231.com">Third Level Link231</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage232.com">Third Level Link232</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage233.com">Third Level Link233</a></li>

</ul>

</ul>

<li onclick="splitID('LI_3')" id="LI_3" title="Click Bullet to Expand"><a href="www.somePage3.com">First Level Link 3</a></li>

<ul id="UL_31" style="display:none">

<li onclick="splitID('LI_31')" id="LI_31" title="Click Bullet to Expand"><a href="www.somePage31.com">Second Level Link 31</a></li>

<ul id="UL_311" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage311.com">Third Level Link311</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage312.com">Third Level Link312</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage313.com">Third Level Link313</a></li>

</ul>

<li onclick="splitID('LI_32')" id="LI_32" title="Click Bullet to Expand"><a href="www.somePage32.com">Second Level Link 32</a></li>

<ul id="UL_321" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage321.com">Third Level Link321</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage322.com">Third Level Link322</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage323.com">Third Level Link323</a></li>

</ul>

<li onclick="splitID('LI_33')" id="LI_33" title="Click Bullet to Expand"><a href="www.somePage33.com">Second Level Link 33</a></li>

<ul id="UL_331" style="display:none">

<li onclick="timesToIgnore = 2"><a href="www.somePage331.com">Third Level Link331</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage332.com">Third Level Link332</a></li>

<li onclick="timesToIgnore = 2"><a href="www.somePage333.com">Third Level Link333</a></li>

</ul>

</ul>

</ul>

</div>


We take a break here and continue in the next part of the series.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

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 11 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials