Jump to content

FF getting too small .contentWindow.document.body.scrollHeight


toxicious
 Share

Recommended Posts

I am using a script for resizing an iframe to fit its content (only the height), but recently when I made some changes to a content page so it gets taller, it refuses to resize that iframe to the right height. Instead it resizes the iframe to about 20 pixels too short. I have no idea why it does that. I have tried in Chrome and IE and there it still works. I have one clue on what it can be: There are like 10 lines of text on that content page, each with <p> tags. It seems that firefox fetches the length of the document, if you measure from the top to the bottom. BUT when it renders the content it renders a padding at the top and the bottom that's about 20px total. It feels like it forgets to take into account that padding when retrieving the height. Am I right? If so, how to solve it?I've tried in both FF Aurora and ordinary FF. EDIT: Oh ######, realized I posted this in the wrong forum, please move to javascript! :facepalm: Also, just to add to the pile of working browsers, even Dreamweaver renders it right!

Edited by toxicious
Link to comment
Share on other sites

What are you using to retrieve height? offsetHeight or scrollHeight, or you could just add 50 to returned height for content height.
The scrollheight (as can be seen in the topic title ;)), I tried with offsetheight but it said exactly the same value. Well yeah I could probably solve it that way, but it feels like stitching two wooden planks together instead of using one that is the wanted length :) I would have solved it that way if all browser would have been wrong, but since Chrome renders it perfectly, and IE renders it OK I want to know if there are another solution or if this is a bug in Firefox.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...