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 6 of 6
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    access to <iframe>

    how do i access the iframe object and particuly the width and height properties of the latter. i have tried

    window.ifrm_name.width = 20
    window.ifrm_name.height = 20
    photoshop too expensive? use the GIMP! www.gimp.org

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think i will rephrase my question to anybody who reads this: how do i change the height and width of an IFRAME object. this Iframe is used as the navigation window in a chromeless window. i need to change the values when the user resizes the window. i dont have ahost for the minute so i cant show the script to you sorry
    photoshop too expensive? use the GIMP! www.gimp.org

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes but in the yourfunc that is called by on resize, i needto resize the iframe thats what i'm getting at. does it ake a differnece if the url of the src of the iframe is outside my domain? thanks fer your patience
    photoshop too expensive? use the GIMP! www.gimp.org

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    refToIframe.style.width = '400px';
    refToIframe.style.height = '300px';

    Is what I would assume.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry but that doesnt work. i have used
    document.idoc.style.width = "700px" (where idoc is the name of the iframe)
    and it doesnt seem to be working.
    photoshop too expensive? use the GIMP! www.gimp.org

  • #6
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Dave, I preferably use:

    document.getElementsByTagName('iframe').item(X)

    Where X is the offset, or

    document.getElementsByName(MyName).item(0)

    where MyName is the name of of the iframe.

    I do this mainly because I am trying to shy away from DOM0 scripting whenever possible, and since the only browsers that support <iframe>'s also support those methods (except for IE4, in which case document.all.tags('iframe')[X] works fine).

    Just another possible way of accessing them .


  •  

    Posting Permissions

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