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