PDA

View Full Version : more iframe help



Clayf700
02-07-2011, 01:07 AM
I Know this has to do with the simple iframe thread, sorry about that
but i'm trying to use this code from an iframe and it's not working

onclick="window.parent.Appear('myDiv');"
What it does is makes a div disappear or appear

here is the javascript code for the appear/disappear command


function Appear(itemID){
// Toggle visibility between hidden and visible
if ((document.getElementById(itemID).style.visibility == 'hidden'))
{
document.getElementById(itemID).style.visibility = 'visible';
} else {
document.getElementById(itemID).style.visibility = 'hidden';
}
}


anyone know why it's not working?

molendijk
02-07-2011, 09:37 PM
It does work, I tested it.
You may have forgotten to put the div with the appropriate id on the main page?
===
Arie.

cascadeorca
02-08-2011, 08:34 PM
Are there any problems with using iframe? I like iframes, but am not sure if there are any problems with browsers or anything.

molendijk
02-08-2011, 09:10 PM
Iframes are OK, see this thread (http://www.dynamicdrive.com/forums/showthread.php?t=60454).
Arie.
===