Bob-Villa
asked on
IE parent scrollheight after iframe resize
I use modal windows with a translucent background.
On the page that uses these windows I have an iframe that holds dynamic content and changes height.
Example.
page load iframe=1000px (H) set by style="height:1000px"
a click on content in iframe reloads it's content and parent.document.getElement ById("iMPF rame").sty le.height changes to 500px (H) via some javascript code.
This works fine, the parent's scrollbar (in client's browser) disappears.
However, the parent's scrollHeight (parent.document.body.scro llHeight) still is set at 1000px. even though the true scrollHeight is a little over 500px.
When I launch the modal window the background assumes the old scrollHeight of 1000px (+surrounding content) instead of the correct value of 500px (+ surrounding content)
I can calculate the true height of the page by getting the iframe height + 96px but wonder why this is not working.
How can I get the correct scrollHeight of the parent without refreshing the parent?
On the page that uses these windows I have an iframe that holds dynamic content and changes height.
Example.
page load iframe=1000px (H) set by style="height:1000px"
a click on content in iframe reloads it's content and parent.document.getElement
This works fine, the parent's scrollbar (in client's browser) disappears.
However, the parent's scrollHeight (parent.document.body.scro
When I launch the modal window the background assumes the old scrollHeight of 1000px (+surrounding content) instead of the correct value of 500px (+ surrounding content)
I can calculate the true height of the page by getting the iframe height + 96px but wonder why this is not working.
How can I get the correct scrollHeight of the parent without refreshing the parent?
<body>
<iframe style="height:1000px" id="frame1" src="dynScript.pl"></iframe>
<body>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.