Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1275075

    I use the wonderful cookie-overlay-mod made by Ismael:

    .cookie-overlay-mod {
    	display: block;
    	z-index: 502;
    	width: 100%;
    	height: 100vh;
    	background: rgba(0,0,0,.8);
    	position: fixed;
    	top: 0;
    	left: 0;
    }
    function ava_custom_privacy_overlay(){
    	?>
    	<script>
    	(function($) {
    		$(document).ready(function() {
    			var consent = $('.avia-cookie-consent');
    
    			if(!consent.is('.cookiebar-hidden')) {
    				$('<div class="cookie-overlay-mod"></div>').appendTo('#wrap_all');
    			}
    		});
    	})(jQuery);
    	</script>
    	<?php
    }
    add_action('wp_footer', 'ava_custom_privacy_overlay', 99);

    Problem: The Overlay does not disappear after clicking the accept button. The page has to be reloaded first.

    #1275210

    Hey frankeee,

    Could you post a link to where we can see the results you are getting please?

    Best regards,
    Rikard

    #1275845

    Hi Rikard,
    the page is still in development mode. Therefore I will give you access via private content.

    #1276898

    Hi Rikard,
    after 4 days i allow myself to ask for an answer. Can you see the problem? do you have any ideas or hints?

    #1277095

    Hi,

    Sorry for the delay. We updated the snippet so that the overlay is removed immediately after accepting the cookies. Please remove the previous script and replace it with the code below.

    function ava_custom_privacy_overlay(){
    	?>
    	<script>
    	(function($) {
    		$(document).ready(function() {
    			var consent = $(".avia-cookie-consent");
    
    			if(!consent.is(".cookiebar-hidden")) {
    				$("<div class='cookie-overlay-mod'></div>").appendTo("#wrap_all");
    			}
    
                            $(".avia-cookie-select-all").on("click", function() {
                                    $(".cookie-overlay-mod").remove();
                            });
    		});
    	})(jQuery);
    	</script>
    	<?php
    }
    add_action('wp_footer', 'ava_custom_privacy_overlay', 99);
    

    Best regards,
    Ismael

    #1278072

    Hi Ismael,
    sorry for my late response – notification about replies seem not to work here. But anyway, thank´s a lot for your script!

    Your script works if the user clicks on accept. However, it does not work if the user go to cookie settings. Can you add this function to your script? So that it also works if the user click into the cookie settings.

    #1278535

    Hi,

    That should be possible. Please look for this line in the code above..

     $(".avia-cookie-select-all").on("click", function() {
    

    .., and replace it with:

     $(".avia-cookie-select-all, .avia-cookie-info-btn").on("click", function() {
    

    Let us know how it goes.

    Best regards,
    Ismael

    #1279189

    … thanks Ismael – this is working!
    You can close this.

    #1279239

    Hi frankeee,

    Great :)

    We are closing the thread.

    If you need further assistance please let us know in a new one.

    Best regards,
    Victoria

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Overlay above the content while the cookies not accepted’ is closed to new replies.