![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
Tagged: cookie bar
-
AuthorPosts
-
January 24, 2021 at 4:26 pm #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.
January 25, 2021 at 11:02 am #1275210Hey frankeee,
Could you post a link to where we can see the results you are getting please?
Best regards,
RikardJanuary 27, 2021 at 6:25 pm #1275845Hi Rikard,
the page is still in development mode. Therefore I will give you access via private content.February 1, 2021 at 6:47 pm #1276898Hi Rikard,
after 4 days i allow myself to ask for an answer. Can you see the problem? do you have any ideas or hints?February 2, 2021 at 11:56 am #1277095Hi,
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,
IsmaelFebruary 5, 2021 at 4:40 pm #1278072Hi 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.
February 8, 2021 at 5:54 am #1278535Hi,
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,
IsmaelFebruary 9, 2021 at 6:43 pm #1279189… thanks Ismael – this is working!
You can close this.February 9, 2021 at 9:07 pm #1279239Hi frankeee,
Great :)
We are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria -
AuthorPosts
- The topic ‘Overlay above the content while the cookies not accepted’ is closed to new replies.