Solved

Ad blocker and jquery rotator

Posted on 2013-12-20
4
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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.
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)

729 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