Solved

Ad blocker and jquery rotator

Posted on 2013-12-20
4
239 Views
Last Modified: 2013-12-20
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
Comment
Question by:meldraper
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 39732113
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
 

Author Comment

by:meldraper
ID: 39732149
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
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39732478
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
 

Author Closing Comment

by:meldraper
ID: 39732494
Thanks Big Daddy.  I appreciate your help.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question