Web Analytics Made Easy -
StatCounter access to <iframe> - CodingForum

Announcement

Collapse
No announcement yet.

access to <iframe>

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        refToIframe.style.width = '400px';
        refToIframe.style.height = '300px';

        Is what I would assume.
        jasonkarldavis.com

        Comment


        • #5
          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

          Comment


          • #6
            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 .
            jasonkarldavis.com

            Comment

            Working...
            X