R
R
Rokis2018-03-03 15:59:41
JavaScript
Rokis, 2018-03-03 15:59:41

How to make a wait timer when adblock is enabled?

Hello.
Suppose there is a button for downloading a file:
<a href="link_to_file" class="load">Скачать</a>
And there is a block with adsense ads:
<div class="adsbygoogle"></div>
How to make it so that if the adsense block is not displayed, then the button is replaced with another one, with a timer, for example:

<a href="no_link" class="dontblock">Пожалуйста, отключите адблок или подождите <span class="timer">60</span>секунд.</a>

Then a button with a download link appears. How to do it in JS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2018-03-03
@sergiks

I did something like this for myself: after a short time, I checked the size of the container for advertising. If not loaded, the size remains small, so hello to AdBlock.

T
tyzberd, 2018-03-03
@tyzberd

https://jsfiddle.net/d3uk65qt/2/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question