Support » Plugin: GDPR Cookie Compliance » Help needed please

  • Resolved mtrehearn

    (@mtrehearn)


    Hi,

    I love the plugin and want to change from another plugin to this one but I am having a bit of trouble implementing it. I have an element on my site that I want to hide until cookies are accepted. To do this at the moment I put the element in a class and have a function that is:

    function showelement() {
    var y = document.getElementsByClassName(“show”);
    var i;
    for (i = 0; i < y.length; i++) {
    y[i].style.display = “block”;
    }

    var y = document.getElementsByClassName(“hide”);
    var i;
    for (i = 0; i < y.length; i++) {
    y[i].style.display = “none”;
    }
    }

    And all I do is call the function when they accept or call another function to hide it (basically the opposite of the above) when they revoke it and when it is revoked it just shows a “content hidden” type image.

    How can I implement that using your plugin?

    Thanks for the help.

Viewing 1 replies (of 1 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @mtrehearn,

    Thanks for using our plugins.

    The easiest way to achieve your goal is using an extra class to your sections, like .gdpr-hide-thirdparty
    The CSS for this class could be :

    .gdpr-hide-thirdparty {
    display: none;
    }

    And in the GDPR Cookie Compliance -> Third party section you can add the following script:

    <script>
    jQuery('.gdpr-hide-thirdparty').removeClass('gdpr-hide-thirdparty');
    </script>

    By this the sections with this extra class will be hidden until your visitors accepts your cookies.

    You can find our hooks, PHP and JavaScript functions in the plugin’s “Help” section in your admin area.

    Hope this helps.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.