Alex-D / Cookies-EU-banner

1kb vanilla JS script which manages cookies consent banner display like asked by GDPR

Home Page:http://alex-d.github.io/Cookies-EU-banner/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cookies Banner displayed on top

wojciehm opened this issue · comments

Hi @Alex-D. Great work.

I have small issue with banner being displayed on top of the webpage. I am using following theme https://github.com/eddiewebb/hugo-resume with Hugo.

This is my code

</head>
<body id="page-top">
    <div id="cookies-eu-banner" style="display: none;">
        By continuing to visit this site, you accept the use of cookies by Google Analytics for statistical purposes.
        <a href="./read-more.html" id="cookies-eu-more">Read more</a>
        <button id="cookies-eu-reject">Reject</button>
        <button id="cookies-eu-accept">Accept</button>
    </div>
  {{ end }}
  <script src="cookies-eu-banner/dist/cookies-eu-banner.min.js"></script>
  <script>
      new CookiesEuBanner(function () {
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  
          // Don't forget to put your own UA-XXXXXXXX-X code
          ga('create', 'UA-XXXXXX-X', 'auto');
          ga('send', 'pageview');
      });
  </script>
</body>

How can I display it on the bottom of the page?

Doing some CSS:

#cookies-eu-banner {
  position: fixed;
  bottom: 0;
}

or something like that ^^