Link to home
Create AccountLog in
Avatar of sasha85
sasha85

asked on

full size iframe

i got a table with 2 td
<table width="880" height="100%" border="1" cellspacing="0" cellpadding="0" align="center" valign="top" dir=rtl>

one with categories
<td align="right" valign="top" height="100%">

and other with the contents(done with iframe)...
<td width="100%" align="center" height=100% valign="top">
<iframe name="prodlist" src="prodlist.htm" width="100%" Height="100%" FRAMEBORDER=0></iframe>
</td>

my poblem is that when the page that being shown inside the iframe is larger(lenght)  than the categories td,
the iframe being show witn a scroller...

i want that the page lenght will deppends on the iframe
how can i do that?

Avatar of MatthewP
MatthewP
Flag of United Kingdom of Great Britain and Northern Ireland image

Assuming that you know how wide your iframe is from the code that created it - which you should, cant you just set the content in the iframe to a specific width? Possibly by putting it all in a div with a style attribute of width which is less than the size of the iframe, say 25-30px less or so, so it should be able to take up a vertical scrollbar without scrolling horizontally.

Will that work for you?

matt
You can try

<iframe name="iframe" src="prodlist.htm" frameborder="0"></iframe>
<script>
window.frames[0].onload=function() {this.style.height=parseInt(window.frames.iframe.document.body.scrollHeight)+50;}
</script>
Avatar of sasha85
sasha85

ASKER

1.the width is not a matter here...what i ask here is how to make always the high of the iframe be the high of the page...in order to prevent from the scroll th apear.
2.Onthrax, i tested your script and i still see the scroller and nothing was changed-still wrong hight
Try these.. If this doesn't work, I'll supply you with a more advanced script.


<iframe style="left:0;position:absolute;top:0" src="prodlist.htm" onload="this.style.height=document.body.clientHeight-(document.all?0:4)"></iframe>

OR

<iframe style="left:0;position:absolute;top:0" src="prodlist.htm" onload="this.style.height=window.frames.iframeName.document.body.scrollHeight"></iframe>
Avatar of sasha85

ASKER

the scroller still there...
Did anything at all change?
Avatar of sasha85

ASKER

yes...it stick to the top right of the page because of this:
style="left:0;position:absolute;top:0"
but everything else is the same...
ASKER CERTIFIED SOLUTION
Avatar of Onthrax
Onthrax
Flag of Netherlands image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of sasha85

ASKER

prfect