Solved

Ad blocker and jquery rotator

Posted on 2013-12-20
4
235 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 32

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 32

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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)

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now