2012年3月10日土曜日

rounder corners fails with ad sense

I'm still looking at this but it actually looks like an IE bug with the IFRAME that's in there. This works great in FireFox (gotta tweak the panel a bit to match the contents):

<asp:Panel ID="publicidad2" runat="server" style="width:728px;height:90px;background-color:#003366" > ...


Thanks, hope you can find a solution and tell it to me :)

Disclaimer: it ain't pretty.

First, drop the height value from the style, that causes problems.

<asp:Panel ID="publicidad2" runat="server" style="width:728px;background-color:#003366;" >

Second, here's the script that I added. Basically it tweaks the iframe just a bit and gets it to show up again.

// ...google_color_text ="FFFFFF";// Workaround for IE issue where the IFRAME disappears// when the rounded extender does it's DOM magic//function fixIFrame() {// test for IE //if (!navigator || !navigator.userAgent || navigator.userAgent.indexOf("MSIE") == -1) {return; }// find the iframe // var behavior = $object("rc");if (!behavior || !behavior.control) {// try again in 100ms window.setTimeout("fixIFrame();", 100);return; }// our outer panel. // var panel = behavior.control.element; var iframes = panel.getElementsByTagName("IFRAME");if (iframes && iframes.length > 0) { iframes[0].style.position ="relative"; }else {// try again in 100ms window.setTimeout("fixIFrame();", 100); }}window.setTimeout("fixIFrame();", 100);// End IE workaround

Enjoy... :)


Thanks soooooooooo much, but i can't get it up :(. It is inhttp://comer.pablocastilla.com

Have i missed something?

<cc1:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server"><cc1:RoundedCornersPropertiesTargetControlID="PanelPublicidad2"Radius="6"/></cc1:RoundedCornersExtender><asp:PanelID="PanelPublicidad2"runat="server"Width="100%"style="background-color:#657da6;"><scripttype="text/javascript"><!--

google_ad_client =

"pub-3740138774592492";

google_ad_width = 728;

google_ad_height = 90;

google_ad_format =

"728x90_as";

google_ad_type =

"text_image";

google_ad_channel =

"";

google_color_border =

"003366";

google_color_bg =

"003366";

google_color_link =

"FF6600";

google_color_url =

"99CCFF";

google_color_text =

"FFFFFF";

//-->

function

fixIFrame() {// test for IE//if (!navigator ||

!navigator.userAgent ||

navigator.userAgent.indexOf(

"MSIE") == -1) {return;

}

// find the iframe//var behavior = $object("rc");if (!behavior || !behavior.control) {// try again in 100ms

window.setTimeout(

"fixIFrame();", 100);return;

}

// our outer panel.//var panel = behavior.control.element;var iframes = panel.getElementsByTagName("IFRAME");if (iframes && iframes.length > 0) {

iframes[0].style.position =

"relative";

}

else {// try again in 100ms

window.setTimeout(

"fixIFrame();", 100);

}

}

window.setTimeout(

"fixIFrame();", 100);</script><scripttype="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></asp:Panel>

Now i have changed to dropshadow and i have the same problem with ie, firefox goes right. And the function provided doesn't work :(

<cc1:DropShadowExtenderID="DropShadowExtenderPublicidad"runat="server"><cc1:DropShadowPropertiesTargetControlID="PanelPublicidad"Rounded="true"TrackPosition="true"/></cc1:DropShadowExtender><asp:PanelID="PanelPublicidad"runat="server"Width="100%"Style="background-color: #657da6;"><scripttype="text/javascript"><!--

google_ad_client =

"pub-3740138774592492";

google_ad_width = 728;

google_ad_height = 90;

google_ad_format =

"728x90_as";

google_ad_type =

"text_image";

google_ad_channel =

"";

google_color_border =

"003366";

google_color_bg =

"003366";

google_color_link =

"FF6600";

google_color_url =

"99CCFF";

google_color_text =

"FFFFFF";

//-->

function

fixIFrame() {// test for IE//if (!navigator ||

!navigator.userAgent ||

navigator.userAgent.indexOf(

"MSIE") == -1) {return;

}

// find the iframe//var behavior = $object("rc");if (!behavior || !behavior.control) {// try again in 100ms

window.setTimeout(

"fixIFrame();", 100);return;

}

// our outer panel.//var panel = behavior.control.element;var iframes = panel.getElementsByTagName("IFRAME");if (iframes && iframes.length > 0) {

iframes[0].style.position =

"relative";

}

else {// try again in 100ms

window.setTimeout(

"fixIFrame();", 100);

}

}

window.setTimeout(

"fixIFrame();", 100);</script><scripttype="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></asp:Panel>

You need to put an id on the rounded corner. I forgot that

<cc1:RoundedCornersPropertiesTargetControlID="PanelPublicidad2"Radius="6" ID="rc"/>


Now works perfect, thanks so much.

Hope I have helped you to find a bug.

0 件のコメント:

コメントを投稿