Frinavale - ur idea is sounding do-able but not sure how esay will it be..
Having 2 "out of domain" pages in one aspx page with dynamic heights
Collapse
X
-
OK we don't need to use cookies at all.
There's an easier way to do this.
The following code will grab the clientHeight (or offsetHeight) of the <body> tag in the iframe.
It isn't perfect though...there' s some sort of padding thing going on that this code doesn't take into consideration so the scroll bar still shows up. I have added something like 20 to the newheight value to compensate for this but for the larger page that I'm testing with it still needs more:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> <script type="text/javascript"> function autoResize(element) { var newheight; if(document.clientHeight) { newheight = element.contentWindow.document.body.clientHeight + 20; }else{ newheight = element.contentWindow.document.body.offsetHeight + 20; } element.style.height = newheight +"px"; } </script> <iframe src="testing.html" id="testing" onload="autoResize(this)"></iframe> <iframe src="HideShowColumnsTest.html" onload="autoResize(this)"></iframe> </body> </html>
Comment
Comment