Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post

    posting ads under iframe - how to prevent overlapp?

    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?
    Code:
    			#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>
    							</div>

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,928
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    Quote Originally Posted by gilgalbiblewhee View Post
    How do you fix it?
    Remove any absolute positioning.

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    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?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,928
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    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”.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •