Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ad blocker and jquery rotator

Posted on 2013-12-20
4
Medium Priority
?
244 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 2000 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

Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)

721 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