Forum Moderators: open
However, I have the following situation:
I have some navigation code containing an iframe which loads up banners from a 3rd party source into an iframe. These banners can be of any size, therefore i need the iframe to dynamicaly resize based on the ad size.
I cannot read the ad size because i do not have access to the properties of the iframe content because it is on another server.
Is there any other way of obtaining the height of the content of the iframe?
tks
Client-side javascript could get messy, and would also be a problem for a certain percentage of your visitors.
If these banners are images (I assume so) then each file format begins with a few bytes that give its dimensions. Some server side processing might be able to pull that information and give it to you dynamically for the iframe dimensions.
I've never done this, but I've heard that it's possible. Still, it is a bit complicated.
My apologies for not haveing anything more definitive to offer.
kind of a crappy way of doin it - but it should work.
also - depending on how you do it on the client-side - the script to resize the iframe wouldn't nessicarily be that bad. I could see how a client-side script could get ugly though. So be careful if you do decide to go that route.
2 points i didn't put in the original message (for fear of making it too confusing on first read ...):
1: ads are a mixture of images and flash and will be any size and shape (yes, shape: they call them flap ads here)
2: making the iframe a big size will not work: i have already set the transparancy on (works for ie and firefox), the problem is that the ads come out over content, and where there is a shaped ad with transparancy the user needs to be able to read the content behind and click on any links there .....