PDA

View Full Version : Function not working in old or new IE, but is fine in FF



RexxCrow
Sep 5th, 2007, 09:37 AM
I have used this effect in various other pages I pages made and they work fine in both IE and FF, but for some reason it is choking in the page I am doing and am failing to see why... any help would be great.

The related JS function...

function display(swap){
var getV=document.getElementById(swap)
if(getV.style.display=='none'){
document.getElementById('AR').style.display='none'
document.getElementById('CS').style.display='none'
document.getElementById('CT').style.display='none'
document.getElementById('CC').style.display='none'
document.getElementById('GS').style.display='none'
document.getElementById('HF').style.display='none'
document.getElementById('ItN').style.display='none'
document.getElementById('K').style.display='none'
document.getElementById('MIC').style.display='none'
document.getElementById('MV').style.display='none'
document.getElementById('NASA').style.display='none'
document.getElementById('911').style.display='none'
document.getElementById('PE').style.display='none'
document.getElementById('DVP').style.display='none'
getV.style.display='block'
}else{
getV.style.display='none'
}
}

This is the the first selection for the Main Menu...

<td><a class="style" href="#AR" onClick="display('AR')" target="" title="">Atlantis & Religion</a></td>


<a name="AR"></a>
<table id="AR" style="display:none">
<tr><td>Atlantis & Religion </td></tr>

<tr><td><a class="" href="#DVP" onClick="loadUp('AR','Testing...','<embed style=&quot;width:800px; height:600px;&quot; id=&quot;VideoPlayback&quot; type=&quot;application/x-shockwave-flash&quot; src=&quot;http://video.google.com/googleplayer.swf?docId=-4253569011792214562&hl=en&quot; flashvars=&quot;&quot;> </embed>')" target="" title="">Testing...</a></td></tr>


The related section to be made visible...
<tr><td><a class="foot" href="#" onClick="cleanup()" title="Click to return to the Main Menu.">Return to Main Menu</a></td></tr>
</table>

RexxCrow
Sep 5th, 2007, 09:49 AM
Ok, I found out what is wrong the anchor tags have to go inside the tables, lame!


Correction the actual problem was that I gave my anchor tags and my td's and table ID's the same name not believing it would cause a conflict, I realized they were different though IE does not, everything is working fine after modifying one of the name sets throughout the page.