html - Why is this JavaScript advertisement cropped only when it's loaded inside of an <iframe>? -
as part of project i'm working on, need load admeld ad (a major ad network) inside of <iframe>
. can't call add directly due complicated cross-browser limitations.
here simple page loads 1 of our ad slot, rotating ad creatives:
http://troy.onespot.com/static/stack_overflow/4949/iframe.html
i can load page day, , ad looks expected - styling i'm including on page is:
* { margin: 0; padding: 0; }
this removes margin , padding on <body>
element, ad butts against top-left of viewport.
this page more accurately simulates how i'm loading ad in project:
http://troy.onespot.com/static/stack_overflow/4949/test.html
it includes <iframe>
loads former page, , same basic styling above remove margin , padding. in general, rendered output of page looks same in first example.
however, in internet explorer 6 & 7 , opera 10 (the browsers i've observed in far), (as in 1 in every 5-30 times page loaded) there gap above ad:
http://skitch.com/troywarr/d4pbg/ad-example
since these browsers have relatively lousy developer tools - or @ least can't figure out how use them - haven't found clues may happening. there don't appear obvious patterns, particular ad creative shows problem, or navigation method causes happen consistently.
what causing this, , can prevent it? experimented additional styling on page displays ad, including:
* { position: fixed; }
while did seem alleviate problem, broke layout of of ad creatives. don't have control of creatives appear, can't rely on far-reaching styling risks breaking of ads; nor can predict elements may appear in ad creatives style them preventatively.
thanks in advance help!
try 1 on iframe:
<iframe src="iframe.html?sfgate_btf" frameborder="0" scrolling="no" width="300" height="250" marginheight="0" marginwidth="0" scrolling="no" hspace="0" vspace="0"></iframe>
Comments
Post a Comment