RobParker

Registered
I've added this code into my header template and it's working ok apart from the vertical spacing which I need a bit of help with.

Code:
<div  style="text-align: center">
 
<script type="text/javascript">
    google_ad_client = "ca-pub-xxxx";
    width = document.documentElement.clientWidth;
    google_ad_slot = "xxxx";
    google_ad_width = 320;
    google_ad_height = 50;
    
    /* Medium banner */
        if (width > 500) {
        google_ad_slot = "xxxx";
        google_ad_width = 468;
        google_ad_height = 60;
    }
           
    /* Large Horizontal 728x90, created 8/6/08 */
    if (width > 800) {
        google_ad_slot = "xxxx";
        google_ad_width = 728;
       google_ad_height = 90;
    }

/* Large */
    if (width > 980) {
        google_ad_slot = "xxxx";
        google_ad_width = 970;
       google_ad_height = 90;
    }
      
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

This looks fine for the larger ads

Screen Shot 2013-07-11 at 19.24.12.png


but for the 468 and 320px ads which are only 60px and 50px highs there's a gap which I'd like to get rid of

Screen Shot 2013-07-11 at 19.26.02.png


Screen Shot 2013-07-11 at 19.26.28.png


Any idea how to remove that spacing without messing everything up?
 
This seems to handle it (any advice on better ways is much appreciated!)

Code:
<xen:if is="@enableResponsive">
@media (max-width:mad:maxResponsiveNarrowWidth)
{
#headerMover #headerProxy {
height: 205px !important;
}
#header .pageWidth .pageContent:after {
height: 10px !important;
}
}
</xen:if>
 
<xen:if is="@enableResponsive">
@media (max-width:mad:maxResponsiveMediumWidth)
{
#headerMover #headerProxy {
height: 205px !important;
}
 
It seems fine, just a heads up too you don't need to use the conditional for each one, you can technically throw all your media queries in it. You really don't need the conditional technically speaking we just post it because it's how XF media queries are by default in case you ever decide to disable the responsiveness, you'll already be set by having the conditional.
 

Pre-Sale Questions

If you have any questions or concerns you want to ask before you make a purchase don't hesitate to use one of our multiple support channels for your convenience.

Back