cewinflorence
Technical User
Hi, I am trying to toggle between two versions of a page;
I've been able to turn visibility/display on and off before
with no problem but now I have two variables I need to pass, ID1 and ID2 as I want to turn one section on and one section off.
I had tried a little function with no variables, just turning on and off the display/visibility in the two parts of the page by identifying these sections by name,
but it did not work.
It's below (I know one problem may be that I may be using CSS names and this is java script; I'm not sure about hide versus hidden for visibility; hidden is CSS):
I've been able to turn visibility/display on and off before
with no problem but now I have two variables I need to pass, ID1 and ID2 as I want to turn one section on and one section off.
I had tried a little function with no variables, just turning on and off the display/visibility in the two parts of the page by identifying these sections by name,
but it did not work.
It's below (I know one problem may be that I may be using CSS names and this is java script; I'm not sure about hide versus hidden for visibility; hidden is CSS):
Code:
// from the headers in the java script section--I also have a browser sniffer
function allezyfr() {
if (type == "IE")
{
document.all.commentaryen.style.display = "none";
document.all.commentairefr.style.visibility = "visible";
document.all.commentairefr.style.display = "";
}
if (type == "NN")
{
document.commentaryen.visibility="hidden";
document.commentaryen.overflow = "hidden";
document.commentaryen.textOverflowMode = "clip";
document.commentaryen.height = "1em";
document.commentairefr.visibility = "visible";
document.commentairefr.overflow = "visible";
document.commentairefr.height = "";
}
if (type == "MO")
{
document.getElementById("commentaryen").style.visibility = "collapse";
document.getElementById("commentairefr").style.visibility = "visible";
}
if (type == "OP")
{
document.getElementById.("commentaryen").style.visibility = "hide";
document.getElementById("commentaryen").style.overflow = "hidden";
document.getElementById("commentaryen").style.textOverflowMo de = "clip";
document.getElementById("commentaryen").style.height = 1em;
document.getElementById("commentairefr").style.visibility = "visible";
document.getElementById("commentairefr").style.overflow = "visible";
document.getElementById("commentairefr").style.height = "";
}
}
</script>
<!-- from the page body -->
<a href="#commentairefr" onclick="allezyfr()">Veuillez voir aussi en français une partie des renseignements ci-dessous/See a portion of this in French.</a>