However, what is happening is, when I click on a childless link, a parent link above it gets the background applied to it instead of the link that was actually clicked. This happens in both IE and FF.
The navigation functions and the onClick functions correctly. However, the style is being applied in the wrong place.
Here's the javascript:
Expand|Select|Wrap|Line Numbers
- function secondarymenuToggle(name,id) {
- var eArray = document.getElementsByTagName('DIV');
- var ele = document.getElementById(id);
- for (i = 0; i < eArray.length; i++)
- {
- if (eArray[i].getAttribute('name') == name)
- eArray[i].className="SecondaryMenu";
- }
- if (ele != undefined)
- ele.className="SecondaryMenuActive";
- }
[PHP]
$link_before = "<a href=\"".$location_var.$option_link."&cbc=1&uspid= ".$option_id."\" CLASS=\"SecondaryMenu\">";
$link_after = "</a>";
$onclick = "onclick=\"displayMenu('".$option_id."', '".$divString."');\"";
$onclick_toggle = "onclick=\"secondarymenuToggle('levelone','levelon e".$levelone_counter."');secondarymenuToggle('leve ltwo','')\"";
echo "<tr $onclick>\n";
echo "<td><div class=\"SecondaryMenu\" $onclick_toggle name=\"levelone\" id=\"levelone".$levelone_counter."\">";
echo "<div class=\"SecondaryMenu\" >".$link_before.$image_var.$link_after.$link_befor e.$option_display_value.$link_after."</div>";
[/PHP]
It seems that maybe the loop is getting mixed up somewhere? I've troubleshot this quite a bit and am not really sure what is happening. If you would like me to better explain the problem, let me know. Unfortunately it is not publicly accessible.