Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Ad blocker and jquery rotator

Hi, I maintain a site for a company that teaches medicare compliance courses.  I have a rotator on the homepage that has five slides showing different areas of education.  It came to my attention this morning that some people who have ad blockers can't see the rotator they just see a blank spot.  Is there any way to detect ad blockers and compensate by just showing a static image or something?  It's in ASP so i can include an if then else statement on error if necessary.  I'm stumped.  Any thoughts would be greatly appreciated.
0
meldraper
Asked:
meldraper
  • 2
  • 2
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
easiest way would be to set up some jquery that detects if your image container height is 0 and go from there. you can't use server side asp code because it doesn't have access to client side properties.

so something like this in your onload function:

if ($('#myAdContainer').height() == 0)
    alert( 'Unblock me!');
0
 
meldraperAuthor Commented:
I would love to try that.  My slideshow is #slideshow2, so is that what i'd need to change out #myadcontainer with?  Also, i'm not very jquery savvy, how do i insert the function and where?  Thanks for your help.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
put this code in your javascript, most likely you have a            

$(document).ready(function () {

somewhere, you would want to put it in there:

$(document).ready(function () {
       if ($('#slideshow2').height() == 0) 
           alert( 'Unblock me!');
});

Open in new window

0
 
meldraperAuthor Commented:
Thanks Big Daddy.  I appreciate your help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now