Hi I am trying to create a while loop and I am having trouble with what to put in it so far I have:
function showSports(obj)
{
var groupId = obj.id.substring(0, 1);
var indx = obj.id.substring(obj.id.indexOf('_') + 1);
var id = indx.substring(0, indx.length + 1);
var displayInfo = false;
while (displayInfo)
{
if (indx == 1)
{
show('footballInfo');
hide('soccerInfo');
hide('baseballInfo');
}
if (indx == 2)
{
show('soccerdInfo');
hide('baseballInfo');
hide('footballInfo');
}
if (indx == 3)
{
show('baseballInfo');
hide('footballInfo');
hide('soccerdInfo');
}
displayInfo = true;
}
}
It is supposed to be able to loop through the links below and show/hide depending on which link is selected.
<a id='1link_1a' title="football Tab" onclick='showSports(this);'>
<span>FootBall</span>
</a>
<a id='1link_1b' title="soccer"
onclick='showSports(this); changeTab(this);'>
<span>Soccer</span>
</a>
<a id='1link_1c' title="baseball" onclick='showSports(this);'>
<span>Baseball</span>
</a>