• Resolved conors37

    (@conors37)


    Hi,

    With the popup option on the cookie bar you have the option to add an overlay to prevent the user from browsing the site without consent. Is it possible to add a similar overlay but with the banner option selected?

    Regards,

    Conor

Viewing 1 replies (of 1 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @conors37,

    By default, overlay option is for popup modal only. Please add the below code in the active theme’s functions.php to add an overlay with banner.

    add_action('wp_footer', 'wt_banner_overlay');
    function wt_banner_overlay() {
        if (class_exists('Cookie_Law_Info')) {
        ?>
            <script>
                jQuery(function($) {
                    if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME) && CLI.settings.cookie_bar_as == 'banner' && CLI.bar_elm.length) {
                        addBannerOverlay();
                    }
                    CLI.showagain_elm.click(function() {
                        if (CLI.settings.cookie_bar_as == 'banner') {
                            addBannerOverlay();
                        }
                    });
                    function addBannerOverlay() {
                        $('body').addClass("cli-barmodal-open");
                        $(".cli-popupbar-overlay").addClass("cli-show");
                    }
                });
            </script>
    <?php
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Banner Overlay’ is closed to new replies.