jQuery Block AdBlock Plugin

A simple javascript for detect AdBlock software and overlay page for confirm for close AdBlock software to user

by Bhupesh Kushwaha

HTML

<link rel="stylesheet" href="https://henscripts.googlecode.com/svn/trunk/BlockAdBlock/assets/jquery.blockBlock.css">
<script src="https://henscripts.googlecode.com/svn/trunk/BlockAdBlock/assets/jquery.blockBlock.js"></script>
<script src="https://henscripts.googlecode.com/svn/trunk/BlockAdBlock/assets/advertisement.js"></script>
<!--add blocker-->

<body>
<div id="top"></div>
<br/>

<h1>jQuery BlockAdBlock</h1>

<div id="page">

<div class="item">

</div>

<div class="item">

</div>

<div class="item">

</div>

<div class="item">
    
</div>

</div>

<p class="credit">Script for jQuery BlockAdBlock Plugin by <a href="http://tutorialzine.com/" title="jQuery Confirm Plugin" target="_blank">Tutorialzine</a> | Demo by <a href="http://modification-blog.blogspot.com/" target="_blank" title="Blogger Tune-Up">Blogger Tune-Up</a></p>
<div id="footer">
<h2>jQuery BlockAdBlock Plugin</h2>
<a href="http://modification-blog.blogspot.com/2012/05/jquery-image-fader.html" class="btu">Read &amp; Download at</a>
</div>

CSS

body, ul, ol, li, p, h1,h2, h3, h4, h5, h6, form, blockquote{margin:0;padding:0;}
body{background-color:#212121;color:#999;display:block;font:13px/1.3 'Segoe UI',Arial,sans-serif;}
*{margin:0;padding:0}
#top{background:url('https://lh4.googleusercontent.com/-QDHA9dSHGyg/TuyZtBjjnFI/AAAAAAAAF30/sEpK9nCYyYk/s800/malubg.png') repeat-x scroll 0 bottom transparent;height:32px;border-bottom:1px solid #000;box-shadow: 0 0 2px #000 inset}
h1 {font:bold 30pt Georgia,serif;text-align:center;color:#444;text-shadow: 1px 1px 0px #000, -1px -1px 0px #606060;}
#footer{background-image:url('https://lh4.googleusercontent.com/-QDHA9dSHGyg/TuyZtBjjnFI/AAAAAAAAF30/sEpK9nCYyYk/s800/malubg.png');background-color:#212121;bottom:0;height:70px;left:0;position:fixed;width:100%;z-index:999;border-top:1px solid #000;-moz-box-shadow:0 1px 0 #302F2F inset}
#footer h2{color:#EEE;font-size:20px;font-weight:normal;left:50%;margin-left:-400px;padding:22px 0;position:absolute;width:400px}
#footer a.btu,a.btu:visited{background:url('https://lh3.googleusercontent.com/-M_IC-3AFy_I/TyvWVHhrJGI/AAAAAAAAGAA/QjaHheGJ8XY/d/refreshlogo.png')/*https://lh5.googleusercontent.com/_xcD4JK_dIjU/Tax6zPwUhlI/AAAAAAAAFEY/HbHkxYVAJiE/s800/btu.png*/ no-repeat scroll right -30px; transparent;border:medium none;color:#FCFCFC;height:30px;left:50%;font-size:12px;line-height:31px;margin:23px 0 0 110px;position:absolute;text-decoration:none;top:0;width:280px;}
#footer a.btu:hover {background-position:right top;}
a,a:visited{color:#97CAE6;outline:medium none;text-decoration:none}
div.dvd-promo {width : 480px; margin : 10px auto; text-align:left;}
.credit{width : 40%; font-size:9pt;text-align:center;display:block;padding:15px 10px;margin:1em auto 80px;color:#7c725f;word-wrap:break-word;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#1a1a19), to(#1f1f1e));background-image:-moz-linear-gradient(#1a1a19, #1f1f1e);background-image:-ms-linear-gradient(#1a1a19,...

JavaScript

$(function () {
  if ($.adblock) {
    $.confirm({
      'title': 'You Are Using AdBlock or some other advert blocking software!',
      'message': 'modification-blog.blogspot.com relies on advertising for revenue. Any small support from you would help us a lot to making this site lives longer and works better.<br/>\
									Please add modification-blog.blogspot.com to your ad blocking whitelist or disable ad blocking or use another browser without any adblocker when you visit modification-blog.blogspot.com<br/>\
									Thanks & Enjoy',
      'buttons': {
        'Yes, I Agree': {
          'class': 'flat',
          'action': function () {
            window.location.reload(true);
          }
        }
      }
    });
  }
});