Results 1 to 7 of 7

Thread: SSI Script II, problem with absolute positioned divs in Firefox

  1. #1
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SSI Script II, problem with absolute positioned divs in Firefox

    1) Script Title: Iframe SSI script II

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...iframessi2.htm

    3) Describe problem:
    I'm using the SSI2 script for dynamically resizing my web page to fit the iframe content. It was working perfectly fine in Explorer, but when I tried opening the page in Firefox, the iframe was being shrunk vertically (to what appears to be the default iframe vertical size).

    The code worked fine from the website in question, so I tried removing all other scripts from my page, and stripping it down to the very basics, but it still wasn't working. So finally I took a look at the page I was loading into the iframe, and tried making some changes to it.

    What I discovered is that a loaded page set up like this works fine:

    HTML Code:
    ...
    <div>
      <img src="content_sample.jpg">
    </div>
    ...
    but one set up like this:

    HTML Code:
    ...
    <div style="position: absolute">
      <img src="content_sample.jpg">
    </div>
    ...
    causes the problem I mentioned above with Firefox. My questions are:

    A) Does this constitute a bug in the aforementioned script? and
    B) Is there any way to make a version of the SSI2 script that works with Firefox?

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    A)Probably Not
    B)I don't know
    My guess is that due to the nature of absolutely positioned boxes(Taken out of normal flow), Firefox is "screwing up". It does not count them as part of scrollHeight. It may be possible to test for absolutely positioned elements and if found add their height to the iframe total.

  3. #3
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, if someone could find a fix for this, it would really help me. I've got a client who wants this page up ASAP, and it would be nice if I could get this feature working in both browsers.

    (Cursing the ongoing lack of universal browser standards, not for the first time...)

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Don't use absolute positioning of content on pages loaded into an iframe using this script unless it has no impact upon the apparent height of the page. FF is actually doing the right thing because an absolutely positioned element adds no height to the page.

    An alternative would be to set the height of the body of the page but, this could cause other problems under some circumstances, ex:

    HTML Code:
    <body height="600">
    Substitute the actual height that you want your page to be for the 600 in the above.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Unfortunately, I need the absolute positioning in order to seamlessly fit the iframe graphics together with the main page.

    I tried adding a <body height="">, but it did not work. I assume that some other part of the script will need to be altered to accomodate that?

    There will NOT be any external content loaded into these iframes, so I can definitely go ahead and include a specified height in them, either as you described above, or in a variable that I specify. I just need to figure out how to adjust the SSI2 script to take that information and use it instead of trying to automatically figure it out. Any suggestions?

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That should have worked. However, when I tested it here, it did not. But, this did:

    HTML Code:
    <body  style="height:880px;">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, that seems to have done it!

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
  •