Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Expandable Banners
filipe
post Nov 13 2008, 08:52 PM
Post #1


Beginner
*

Group: Members
Posts: 5
Joined: 25-June 08
Member No.: 21,936



I found a good and simple cross-browser solution for this that may be useful for some of the many people who experience problems with expandable banners. It doesn't require any code into the flash banner or by the OpenX operator, who may know nothing of programming languages.

Here it goes:

A simple solution is to create a DIV (id="theDiv") surrounding the banner and putting a javascript code to be delivered together with the expandable banner (OpenX > "Expandable Banner" > Advanced Tab) that resizes the DIV to the retracted size (in my case, 90px).

CODE
<script language="javascript">
document.getElementById("theDiv").style.height = "90px";
</script>


This solution works fine on all browser, but, on non-browsers like IE, the div size doesn't become smaller than the banner expanded size, so there's a gap that pushes the HTML down.

A complete solution is to create two DIVs surrounding the banner, one to occupy the default banner height and another (a floating and transparent one) to contain the banner itself. This way, the HTML and the banner will always be on the same place and when the banner is expanded, it overlaps the HTML seamlessly.

CODE
<div id="occupationDiv">
<div id="bannerDiv" style="position: absolute; background-color:transparent;">
{OPENX_BANNER_CODE}
</div>
</div>


With this done, you just need to tell the Zone to always adjust the divs height when there's a banner delivered (if there isn't a banner to be delivered, the divs will stay invisible). To do this, go to OpenX > Zones > "Expandable-or-not Banners Zone" > Advanced and put the following HTML code to be delivered (sign the option to not deliver the code when there are no banners to be delivered):

CODE

<script language="javascript">
document.getElementById("bannerDiv").style.height = "90px";
document.getElementById("occupationDiv").style.height = "90px";
</script>


That's all. It worked for me on all browsers and even on IE.

I don't know if this solution depends on the banner also, but I don't think so.

Hope it helps.

Regards,

Filipe
Go to the top of the page
 
+Quote Post
frank239
post Apr 27 2009, 09:11 AM
Post #2


Beginner
*

Group: Members
Posts: 4
Joined: 24-April 09
Member No.: 27,659



is this banner useful in all templets.
Go to the top of the page
 
+Quote Post
Ram Kumar
post May 4 2009, 09:53 AM
Post #3


Advanced Member
***

Group: Members
Posts: 72
Joined: 27-June 07
From: Bangalore, India
Member No.: 17,041



Hi

I tried this. Its working fine for me. rolleyes.gif

It's really useful for me.


Thanks

QUOTE (filipe @ Nov 14 2008, 02:22 AM) *
I found a good and simple cross-browser solution for this that may be useful for some of the many people who experience problems with expandable banners. It doesn't require any code into the flash banner or by the OpenX operator, who may know nothing of programming languages.

Here it goes:

A simple solution is to create a DIV (id="theDiv") surrounding the banner and putting a javascript code to be delivered together with the expandable banner (OpenX > "Expandable Banner" > Advanced Tab) that resizes the DIV to the retracted size (in my case, 90px).

CODE
<script language="javascript">
document.getElementById("theDiv").style.height = "90px";
</script>


This solution works fine on all browser, but, on non-browsers like IE, the div size doesn't become smaller than the banner expanded size, so there's a gap that pushes the HTML down.

A complete solution is to create two DIVs surrounding the banner, one to occupy the default banner height and another (a floating and transparent one) to contain the banner itself. This way, the HTML and the banner will always be on the same place and when the banner is expanded, it overlaps the HTML seamlessly.

CODE
<div id="occupationDiv">
<div id="bannerDiv" style="position: absolute; background-color:transparent;">
{OPENX_BANNER_CODE}
</div>
</div>


With this done, you just need to tell the Zone to always adjust the divs height when there's a banner delivered (if there isn't a banner to be delivered, the divs will stay invisible). To do this, go to OpenX > Zones > "Expandable-or-not Banners Zone" > Advanced and put the following HTML code to be delivered (sign the option to not deliver the code when there are no banners to be delivered):

CODE

<script language="javascript">
document.getElementById("bannerDiv").style.height = "90px";
document.getElementById("occupationDiv").style.height = "90px";
</script>


That's all. It worked for me on all browsers and even on IE.

I don't know if this solution depends on the banner also, but I don't think so.

Hope it helps.

Regards,

Filipe
Go to the top of the page
 
+Quote Post
nisal
post Jun 1 2009, 06:58 AM
Post #4


Beginner
*

Group: Members
Posts: 2
Joined: 3-August 08
Member No.: 22,586



Hi,

Can anyone help me on what does it means "{OPENX_BANNER_CODE}". I would really appreciate if anyone can post full example code as I'm new for OpenX.

Thanks
Nisal
Go to the top of the page
 
+Quote Post
gandaria7001
post Oct 8 2009, 04:14 PM
Post #5


Beginner
*

Group: Members
Posts: 2
Joined: 8-October 09
Member No.: 56,581



Expandable banner ads load on the page as a standard sized banner ad, and upon rollover, they expand to show one or more panels with additional messaging.




__________________
Band Merchandise
Go to the top of the page
 
+Quote Post
janetvelasquez80...
post Oct 13 2009, 02:56 PM
Post #6


Beginner
*

Group: Members
Posts: 1
Joined: 13-October 09
Member No.: 58,121



Hi,

Does this work for Netscape Explorer?

thanks

Hubschrauber selber fliegen
Go to the top of the page
 
+Quote Post
padunic
post Nov 2 2009, 12:54 AM
Post #7


Beginner
*

Group: Members
Posts: 7
Joined: 19-September 09
Member No.: 49,981



Hi,

First sorry about my bad english.

i made step by step your suggestion and works, but i dont know if because i'm using joomla the banner expand behind of some elements of template.

Could you, please, help me about that?

The url: http://www.informesaude.com.br/privacidade

Thank you so much.

Padunic
Go to the top of the page
 
+Quote Post
padunic
post Nov 3 2009, 04:35 PM
Post #8


Beginner
*

Group: Members
Posts: 7
Joined: 19-September 09
Member No.: 49,981



QUOTE (padunic @ Nov 2 2009, 01:54 AM) *
Hi,

First sorry about my bad english.

i made step by step your suggestion and works, but i dont know if because i'm using joomla the banner expand behind of some elements of template.

Could you, please, help me about that?

The url: http://www.informesaude.com.br/privacidade

Thank you so much.

Padunic



Hi, all.

I made it works in Joomla template (www.saudemail.com.br/informesaude/), but I had not realized that the links in the menu were visible, but inaccessible. It seems that the layer is in front of them.

someone could, please, verify and give me some suggestion?

regards

Padunic
Go to the top of the page
 
+Quote Post
mathg
post Nov 17 2009, 01:40 PM
Post #9


Beginner
*

Group: Members
Posts: 1
Joined: 18-August 09
Member No.: 34,491



I had that same problem where my expand would go over my nav and make it disabled even when closed.

I added theses small jquery lines on the page needing the expand.

CODE
<script type="text/javascript">
$(document).ready(function(){
$('#bannerDiv').mouseover(function(){
$('#bannerDiv').height(350);
return false;
})

$('#bannerDiv').mouseout(function(){
if($('#bannerDiv').height()==350){
$('#bannerDiv').animate({height:'-=260'},500);
}
return false;
})
});
</script>


And on the banner div I added the style "overflow: hidden;" and now everything works like a charm!

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Locations of visitors to this page