Good day! Tell adblock_button_close what could be the problem, the adblock_button_close button does not work, adBlockDetected in display: none styles display: none

 var adBlockDetected = function() { $('.forCenterBlock').css('display', 'block'); } var adBlockUndetected = function() { $('.forCenterBlock').css('display', 'none'); } if(typeof FuckAdBlock === 'undefined') { $(document).ready(adBlockDetected); } else { fuckAdBlock.on(true, adBlockDetected).on(false, adBlockUndetected); } $(".adblock_button_close").click(function(){ $('.forCenterBlock').css('display', 'none'); }); 

There is a forCenterBlock div , which initially display: none; (spelled in css ). When the page loads, if FuckAdBlock === 'undefined' block forCenterBlock must be assigned to display:block; otherwise display: none; .

And there is an adblock_button_close button, which, on click, should assign the forCenterBlock display: none; block forCenterBlock display: none;

That button for some reason does not work)

Closed due to the fact that off-topic participants Grundy , aleksandr barakin , user194374, Denis , dirkgntly Aug 22 '16 at 8:50 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Grundy, aleksandr barakin, Spirit of the community, Denis, dirkgntly
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • FuckAdBlock and fuckAdBlock are two different variables. The error fuckAdBlock is undefined should fall out - Sanya_Zol
  • 2
    Describe in more detail. What does "not working" mean? Does the forCenterBlock block forCenterBlock ? Who in display:none styles? Almost nothing is clear. - Ivan Pshenitsyn
  • 1 - console errors? 2 - is the adblock_button_close button present on the page immediately upon its loading, or is it added later? - Ivan Pshenitsyn

0