AdBlock Blocking Code 2021
AdBlock Blocking Code 2021
Many websites cover server costs thanks to the ads they place on their sites. Of course, some users who are not aware of this use AdBlock to access these sites and benefit from the site without seeing the ads.
Well, if you are a site owner who complains about this situation, you can use this code to prevent those entering your site from blocking ads.
The only thing you need to do to use it is to add the following code between the "<body> Add the code here </body>" tags on the pages where you don't want users with ad blockers to enter.
<style>
#adblock-kullanicisi { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.8); text-align: center; box-sizing: border-box; padding-top: 50px; z-index: 9999999; }
#adblock-kullanicisi .adblock-kullanicisi-ic { position: absolute; z-index: 99999999; background-color: rgba(245,245,245,1.00); box-sizing: border-box; width: auto; height: auto; left: 50%; top: 50%; margin-left: -400px; margin-top: -225px; padding: 40px; }
#adblock-kullanicisi .adblock-kullanicisi-ic .bir { font-size: 32px; line-height: 32px; font-weight: 600; margin-bottom: 20px; }
#adblock-kullanicisi .adblock-kullanicisi-ic .iki { font-size: 14px; line-height: 14px; }
</style>
<script type="text/javascript">
(function()
{
var test = document.createElement('div');
test.innerHTML = ' ';
test.className = 'adsbox';
document.body.appendChild(test);
window.setTimeout(function()
{
if (test.offsetHeight === 0)
{
document.body.classList.add('adblock');
document.getElementById('adblock-kullanicisi').style.display = 'block';
var scrollPosition = [
self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
];
var html = jQuery('html');
html.data('scroll-position', scrollPosition);
html.data('previous-overflow', html.css('overflow'));
html.css('overflow', 'hidden');
window.scrollTo(scrollPosition[0], scrollPosition[1]);
}
test.remove();
}, 100);
})();
</script>
<div id="adblock-kullanicisi" style="padding:50px;"><div class="adblock-kullanicisi-ic"><img alt="stats" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdbFALvtPDkfwi1uNzBNiOgVMWMhikDjXobRlKyuk_bcdagW9-BgY5DQrtAAfXGfHli8fIO12FAjMnqCgESCdDKvLbvBkVZJoQoXcanHtsDgIGNR33HOf4ca00LCqHdYA8FZFnuwRLJcs9/s1600/Urhoba+Logosm.png" border="0" /><div style="padding:20px;"><a href="javascript: window.location.href=window.location;">I turned off the blocker!</a></div></div></div>
If you want to make sure the code works, you can try visiting this page using any ad-blocking program.



Yorum Gönder