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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts

    IFRAMES and sizing?

    If I have an iframe in a page that serves ads..
    sometimes there might be 5 ads, other times 2 ads etc..
    Is there a way to have the iframe expand to accomodate any amount
    of ads without losing space...

    so if there there 2 ads....I don't want the iframe shownig the same size
    as 5 ads....a waste of space, and it would look funny on a page.

    etc...

  • #2
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If the location of your iframe is from your server you can. But since I do not know of any ad servers that allow this then it is not possible.
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts
    well yes, the ad server willl serving up its own page within the iframe....so, its not in the same domain...

    so, what are my options...

    lets say...
    if there are 5 ads..the size of the page is 300 X 500
    if there are 3 ads..the size of the page is 300 X 250

    I want the iframe to vary its height depending no the content that is generated..

    If I don't set a 'height' in the iframe, wont it just automatically size it self appropriately?

  • #4
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No iframes default to their normal size...
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You could use javascript if your ads were being generated on your own server but since they aren't, you'll get an access denied error.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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