Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Nov 2003
    Location
    nowhere
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question control iframe properties~

    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 ???
    Never end on learning~

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    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';

  • #3
    New Coder
    Join Date
    Nov 2003
    Location
    nowhere
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 ?
    Last edited by black; 02-12-2004 at 10:49 AM.
    Never end on learning~

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    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".

  • #5
    New Coder
    Join Date
    Nov 2003
    Location
    nowhere
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 ?
    Never end on learning~

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    visible

    why don't you want the display property?

  • #7
    New Coder
    Join Date
    Nov 2003
    Location
    nowhere
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Never end on learning~

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    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';

  • #9
    Regular Coder
    Join Date
    Dec 2003
    Location
    USA
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by black
    frankly, i dont konw how to use display... lol i search w3c site but find no reference on that...
    Display

    Visibility

  • #10
    Regular Coder
    Join Date
    Jan 2004
    Location
    Maryland
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #11
    New Coder
    Join Date
    Nov 2003
    Location
    nowhere
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanx guys. i think now i got more sense for iframe, thanx...
    Never end on learning~


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •