In the previous part of this two-part tutorial, I began describing how to build a bulleted menu of links, such as you might see on many web sites. These links unfold, so that some headings, when clicked, reveal links below them to pages that are subcategories. In this second part, I will jump right back into the subject, starting with the JavaScript code we need to accomplish the magic.
Completing a Bulleted Menu Of Links - Other List-Item Markers (Page 5 of 5 )
In HTML (CSS and JavaScript) parlance, a bullet is called a List-Item Marker. You can have images as list-item markers. You can have one image to indicate an expanded list-item, another to indicate a collapsed list-item and yet another to indicate a list-item that is not expandable. To achieve this, the style attribute should be:
Style = “list-style-image: url(bullet.gif)”
where “bullet.gif” should be replaced by the path and name of the image of the bullet.
Conclusion
Expandable bulleted links, as I have explained, can be used on a web page when you need something to the effect of a menu. When a list item is expanded, you can see the links that are a subset of a higher-level link.
Your own project lists may not be as structured as the one we discussed in these two articles. That is, a first level link may have only one sub-list and no third level, while another first level link may even have a fourth level link. All you have to do is to modify the above code to suit your purpose.
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.