rvl
01-30-2008, 10:46 PM
I have a document with a <div> layer and and iframe.
The <div> is set to be visible and the iframe is set hidden.
Clicking a button in the <div> calls a function that loads a frameset into the iframe then makes the iframe visible and hides the <div>.
I want a button in the frameset to hide its parent iframe and show the <div> again.
The following function works - if the button in the iframe is not contained in a frameset. The function is passed the names of the <div> and iframe.
function toggleDisplay(d1,d2) {
if(parent.document.getElementById(d1).style.display == "none")
{parent.document.getElementById(d1).style.display = "block"; }
else { parent.document.getElementById(d1).style.display = "none"; }
if(parent.document.getElementById(d2).style.display == "none")
{ parent.document.getElementById(d2).style.display = "block"; }
else {parent.document.getElementById(d2).style.display = "none"; }
}
But I'm having no luck getting out of the frameset. I've tried variations like:
parent.parent.document... parent.parent.parent.document... crazy stabs in the dark.
Can someone offer a solution and shed some light on this?
The <div> is set to be visible and the iframe is set hidden.
Clicking a button in the <div> calls a function that loads a frameset into the iframe then makes the iframe visible and hides the <div>.
I want a button in the frameset to hide its parent iframe and show the <div> again.
The following function works - if the button in the iframe is not contained in a frameset. The function is passed the names of the <div> and iframe.
function toggleDisplay(d1,d2) {
if(parent.document.getElementById(d1).style.display == "none")
{parent.document.getElementById(d1).style.display = "block"; }
else { parent.document.getElementById(d1).style.display = "none"; }
if(parent.document.getElementById(d2).style.display == "none")
{ parent.document.getElementById(d2).style.display = "block"; }
else {parent.document.getElementById(d2).style.display = "none"; }
}
But I'm having no luck getting out of the frameset. I've tried variations like:
parent.parent.document... parent.parent.parent.document... crazy stabs in the dark.
Can someone offer a solution and shed some light on this?