Results 1 to 2 of 2

Thread: Expand iframe height according to content?

  1. #1
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Exclamation Expand iframe height according to content?

    Is it possible to have the height of an iframe expand itself according to the content as opposed to specifying width and height absolutely.

    I have this now.
    Code:
    <iframe src="<url>" width="945px" height="800px" marginwidth="0" marginheight="0" frameborder="no" scrolling="no" style="border-width:0px; border-color:#333; background:#FFFFFF; border-style:solid;"> </iframe>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    In general this is only possible if the page being shown inside the IFRAME is from the same domain as the page displaying the IFRAME. This is due to JavaScript security limitations that prohibit one page from finding out info of another page (ie: height) unless they're on the same domain. With that said, you may want to look at the code of IFRAME SSI script to get a general understanding of how to go about adjusting the height of the IFRAME based on its contents.
    DD Admin

Bookmarks

Posting Permissions

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