Skip to content

Instantly share code, notes, and snippets.

@aidik
Created June 16, 2025 08:16
Show Gist options
  • Save aidik/c92428e8cc5f76a4c75a9a959d094ed0 to your computer and use it in GitHub Desktop.
Save aidik/c92428e8cc5f76a4c75a9a959d094ed0 to your computer and use it in GitHub Desktop.

Revisions

  1. aidik created this gist Jun 16, 2025.
    21 changes: 21 additions & 0 deletions eu-cookie.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <div class="eu-cookies">
    XYZ123 values privacy for all visitors. Learn more about how we use cookies and how you can control them by reading our <a href="https://www.XYZ123.com/privacy-policy/">Privacy Policy</a>.
    <button>I Agree</button>
    </div>

    <script>
    jQuery(document).ready(function(){
    if( document.cookie.match(/eu-cookies=/) == null )
    {
    jQuery(".eu-cookies").addClass( "eu-cookies-show" ).removeClass( "eu-cookies" );
    jQuery("#footer").css("margin-bottom", jQuery(".eu-cookies-show").outerHeight());

    jQuery('.eu-cookies-show button').click(function() {
    var date = new Date();
    date.setFullYear(date.getFullYear() + 10);
    document.cookie = 'eu-cookies=1; path=/; expires=' + date.toGMTString();
    jQuery('.eu-cookies-show').hide();
    });
    }
    });
    </script>