...

View Full Version : control iframe properties~



black
02-12-2004, 10:01 AM
howdy~

I want JavaScript control iframe properties and the page nested, for example i'd like to switch visibility of iframe by clicking somewhat checkbox, how to achieve that plz ??? :rolleyes:

glenngv
02-12-2004, 10:40 AM
set the css display property to none

<iframe id="ifr" src="page.htm" style="display:none"></iframe>

then toggle its value to inline/none to display/hide as the checkbox is checked/unchecked.
i.e.
document.getElementById("ifr").style.display='inline';

black
02-12-2004, 10:47 AM
Originally posted by glenngv
set the css display property to none

<iframe id="ifr" src="page.htm" style="display:none"></iframe>

then toggle its value to inline/none to display/hide as the checkbox is checked/unchecked.
i.e.
document.getElementById("ifr").style.display='inline';

thanx, can that display control whether the iframe be hidden or not ?
and what values can i take from the visibility property ?

glenngv
02-12-2004, 10:58 AM
I said display property not visibility although they are similar. display does not occupy space when set to "none", while visibility still occupies the space even when set to "hidden".

black
02-12-2004, 10:59 AM
Originally posted by glenngv
I said display property not visibility although they are similar. display does not occupy space when set to "none", while visibility still occupies the space even when set to "hidden".

thanx again man~

and what about the value if i want visibility shown ? is that "shown" or "unhidden" or anything else ? :rolleyes:

glenngv
02-12-2004, 11:03 AM
visible

why don't you want the display property?

black
02-13-2004, 02:09 AM
Originally posted by glenngv
visible

why don't you want the display property?

frankly, i dont konw how to use display... lol i search w3c site but find no reference on that... :eek:

glenngv
02-13-2004, 02:51 AM
I already told you how to use it, didn't I?



Originally posted by glenngv
set the css display property to none

<iframe id="ifr" src="page.htm" style="display:none"></iframe>

then toggle its value to inline/none to display/hide as the checkbox is checked/unchecked.
i.e.
document.getElementById("ifr").style.display='inline';

Paul Jr
02-13-2004, 04:49 AM
Originally posted by black
frankly, i dont konw how to use display... lol i search w3c site but find no reference on that... :eek:
Display (http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-display)

Visibility (http://www.w3.org/TR/REC-CSS2/visufx.html#propdef-visibility)

squirellplaying
02-13-2004, 05:05 AM
Hey, I would find anouther way then using an IFRAME to display your data. Search google for alternatives and you'll find a few. I say this because I've been working on a page with one on it and IFRAME is not a good choice if you want it to work in multiple browsers. Firefox does not support it as I know. Just a heads up if you want to reach the most users.

black
02-13-2004, 07:09 AM
thanx guys. i think now i got more sense for iframe, thanx... :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum