Bulleted Menu of Links - Code continued
(Page 4 of 5 )
{
//var 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>";
var string111 = "<li><a href='www.somePage111.com' style='list-style-type: square'>Third Level Link 111</a></li>";
var string112 = "<li><a href='www.somePage112.com' style='list-style-type: square'>Third Level Link 112</a></li>";
var string113 = "<li><a href='www.somePage112.com' style='list-style-type: square'>Third Level Link 113</a></li>";
//var 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>";
var string121 = "<li><a href='www.somePage121.com' style='list-style-type: square'>Third Level Link 121</a></li>";
var string122 = "<li><a href='www.somePage122.com' style='list-style-type: square'>Third Level Link 122</a></li>";
var string123 = "<li><a href='www.somePage123.com' style='list-style-type: square'>Third Level Link 123</a></li>";
//var 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>";
var string131 = "<li><a href='www.somePage131.com' style='list-style-type: square'>Third Level Link 131</a></li>";
var string132 = "<li><a href='www.somePage132.com' style='list-style-type: square'>Third Level Link 132</a></li>";
var string133 = "<li><a href='www.somePage133.com' style='list-style-type: square'>Third Level Link 133</a></li>";
//verify which list item was clicked and give its global variable its value
switch(ID)
{
case "FLL1":
if (FLL1Direction == "Expand")
{
FLL1Direction = "Collapse"
}
else if (FLL1Direction == "Collapse")
{
FLL1Direction = "Expand"
}
else //the first time the link it clicked.
{
FLL1Direction = "Expand"
}
break;
case "SLL11":
if (SLL11Direction == "Expand")
{
SLL11Direction = "Collapse"
}
else if (SLL11Direction == "Collapse")
{
SLL11Direction = "Expand"
}
else //the first time the link it clicked.
{
SLL11Direction = "Expand"
}
break;
case "SLL12":
if (SLL12Direction == "Expand")
{
SLL12Direction = "Collapse"
}
else if (SLL12Direction == "Collapse")
{
SLL12Direction = "Expand"
}
else //the first time the link it clicked.
{
SLL12Direction = "Expand"
}
break;
case "SLL13":
if (SLL13Direction == "Expand")
{
SLL13Direction = "Collapse"
}
else if (SLL13Direction == "Collapse")
{
SLL13Direction = "Expand"
}
else //the first time the link it clicked.
{
SLL13Direction = "Expand"
}
}
Next: Even More Code >>
More JavaScript Articles
More By Chrysanthus Forcha