View Full Version : posting ads under iframe - how to prevent overlapp?

08-08-2007, 03:50 PM
I need to post ads under the iframe. But the iframe changes height as you navigate and it creates overlapping with the ads. How do you fix it?

#ifrindexdiv {
position: absolute;
left: 0px;
top: 0px;
<%'text-align: center;%>
margin: auto;
border: 0px;
#ifrindex {
position: relative;
left: 0px;
top: 0px;
width: 875px;
height: 1800px;
scrolling: none;
<%'border: double 2px #553C1D;%>

<div id="ifrindexdiv">
<iframe name="ifrindex" id="ifrindex" allowtransparency="false" src="forums/index.php" frameborder="0" scrolling="no"></iframe>

08-08-2007, 04:01 PM
How do you fix it?

Remove any absolute positioning.

08-08-2007, 04:31 PM
Ok What I did was to place the advertisement in the same div tag as the iframe. But the problem now is that since the iframe is long in height to make some of the pages to fit there are other times when it's short and the ad would remain way at the bottom.

Is it possible to shrink the iframe when it doesn't need to be long in height?

08-08-2007, 04:40 PM
OK, the question is why you have to use an iframe anyway, because I see that you are just drawing another page from your own site. But anyway, you need JavaScript to make the iframe resize to its content. There are a couple of free scripts out there although I don’t really know one I can recommend as I haven’t dealt with that so much. Just search for “iframe resize”.