Forum Moderators: phranque

Message Too Old, No Replies

Display a generic alternate image if site users use AdBlock?

When AdBlock is enabled, other site elements move

         

kirikara

5:22 pm on Sep 27, 2009 (gmt 0)

10+ Year Member



Hello, I hope I am posting to an appropriate board.

I have an issue with elements not displaying correctly when users of my site are using AdBlock Plus. Basically, the ad element disappears, but there is another element on my site (RSS icon) that relies on the positioning of that 468x60 block.

My question is - how can I define that 468x60 ad position to display a generic image when the ad is blocked? There is probably a simple way to do this but I haven't been able to come up with it myself. My ideas were to define the ad inside a div which has a hard-coded height and width (didn't work), or to display the ad overtop of a transparent 468x60 image all the time (couldn't figure out how to do that).

Thanks for reading my issue, I would really appreciate any help!

[edited by: phranque at 1:36 am (utc) on Sep. 28, 2009]
[edit reason] No urls, please. See TOS [webmasterworld.com] [/edit]

bill

5:04 am on Sep 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may have been heading in the right direction with the <div> for the ad. It depends on your page structure though.

kirikara

9:10 pm on Sep 28, 2009 (gmt 0)

10+ Year Member



I am using Joomla if that helps. Unfortunately I can't link to my site here to show you what I'm talking about.

[edited by: phranque at 11:16 am (utc) on Sep. 29, 2009]

D_Blackwell

8:36 pm on Sep 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I like some of the potential extended logic to this. Can you slip and slide enough to replace the blocked ad with another ad or useful equivalent?

bill

1:35 am on Sep 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why not? Use a background image and then run the ad on top of it.

kirikara

12:54 pm on Sep 30, 2009 (gmt 0)

10+ Year Member



How would I run an AdSense ad on top of a background image? That is what I would like to do ideally but I'm not sure how to code that exactly...

maximillianos

2:55 pm on Sep 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just embed the Adsense code in a table or div and set the background to an image. Just make sure the image is the same size as the ad block (or smaller).

kirikara

3:46 pm on Sep 30, 2009 (gmt 0)

10+ Year Member



It turns out I was coding the DIV wrongly - I was trying

<div height="60px" width="468px">

and it should have been

<div style="height:60px;width:468px">

Thanks for your help guys!