Home arrow JavaScript arrow Page 5 - Bulleted Menu of Links
JAVASCRIPT

Bulleted Menu of Links


In this article, I will be going over the various features of a bulleted menu of links, including how to implement them in your web page. All explanations will be accompanied by code samples to help you through this process. If you want to learn more about this common web page function, then, by all means, keep reading.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
April 23, 2008
TABLE OF CONTENTS:
  1. · Bulleted Menu of Links
  2. · Operation from the User’s Point of View
  3. · Algorithm
  4. · Code continued
  5. · Even More Code

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Bulleted Menu of Links - Even More Code
(Page 5 of 5 )

//form the string

if (SLL11Direction == "Expand")

{

string11 = "<li onclick="formString('SLL11')" id="SLLLI11" style='list-style-type: circle'
title="Click Bullet to Collapse"><a href='www.somePage11.com' id="SLL11" title='Click Bullet to Expand'>Second Level Link 11</a></li>";

string11 = string11 + "<ul id='SLUL11'>"+ string111 + string112 + string113 + "</ul>";

}

else

{

string11 = "<li onclick="formString('SLL11')" id="SLLLI11" style='list-style-type: disc'
title="Click Bullet to Expand"><a href='www.somePage11.com' id="SLL11" title='Click Bullet to Expand'>Second Level Link 11</a></li>";

}

 

if (SLL12Direction == "Expand")

{

string12 = "<li onclick="formString('SLL12')" id="SLLLI12" style='list-style-type: circle'
title="Click Bullet to Collapse"><a href='www.somePage12.com' id="SLL12" title='Click Bullet to Expand'>Second Level Link 12</a></li>";

string12 = string12 + "<ul id='SLUL12'>"+ string121 + string122 + string123 + "</ul>";

}

else

{

string12 = "<li onclick="formString('SLL12')" id="SLLLI12" style='list-style-type: disc'
title="Click Bullet to Expand"><a href='www.somePage12.com' id="SLL12" title='Click Bullet to Expand'>Second Level Link 12</a></li>";

}

 

if (SLL13Direction == "Expand")

{

string13 = "<li onclick="formString('SLL13')" id="SLLLI13" style='list-style-type: circle'
title="Click Bullet to Collapse"><a href='www.somePage13.com' id="SLL13" title='Click Bullet to Expand'>Second Level Link 13</a></li>";

string13 = string13 + "<ul id='SLUL13'>"+ string131 + string132 + string133 + "</ul>";

}

else

{

string13 = "<li onclick="formString('SLL13')" id="SLLLI13" style='list-style-type: disc'
title="Click Bullet to Expand"><a href='www.somePage13.com' id="SLL13" title='Click Bullet to Expand'>Second Level Link 13</a></li>";

}

 

 

if (FLL1Direction == "Expand")

{

string1 = "<li onclick="formString('FLL1')" id="FLLLI1" style='list-style-type: circle' title="Click Bullet to Collapse"><a href='www.somePage1.com' id="FLL1" title='Click Bullet to Expand'>First Level Link 1</a></li>";

string1 = string1 + "<ul id='SLUL1'>"+ string11 + string12 + string13 + "</ul>";

}

else

{

string1 = "<li onclick="formString('FLL1')" id="FLLLI1" style='list-style-type: disc' title="Click Bullet to Expand"><a href='www.somePage1.com' id="FLL1" title='DoubleClick to Expand'>First Level Link 1</a></li>";

 

FLL1Direction = "";

SLL11Direction = "";

SLL12Direction = "";

SLL13Direction = "";

}


//combine the first level global strings

var completeString = "<ul>" + string1 + string2 + string3 + "</ul>";


//give the table cell its new link arrangement

document.getElementById("TDL").innerHTML = completeString;


}

</script>

</head>


<body>


<table>

<tbody>

<tr>

<td id="TDL">

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

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

<li><a href="www.somePage2.com" title="Click Bullet to Expand">First Level Link 2</a></li>

<li><a href="www.somePage3.com" title="Click Bullet to Expand">First Level Link 3</a></li>

</ul>

</td>

</tr>

</tbody>

</table>


</body>

</html>


Other List-Item Markers

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 can be used on a web page when you need something to have the effect of a menu. When a list item is expanded, you can see the links that are the subset of the higher-level link.


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
JAVASCRIPT ARTICLES

- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks
- Dynamic jQuery Styling

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