-
-
Save bavington/6727776 to your computer and use it in GitHub Desktop.
You can use this css:
/* [COOKIE BANNER] */
#cookie-law {
position: fixed;
z-index: 99999;
background: white;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
padding: 30px 0;
right: 0;
bottom: 0;
left: 0;
}
#cookie-law p {
margin: 0;
}
.close-cookie-banner span {
position: absolute;
top: 0;
color: black;
font-size: 25px;
}
/* [/COOKIE BANNER] */
I created a fork which does not pollute the global namespace.
Also, it per default requires a click to make the banner stay away, but can easily be modified to only show once in a while, like this.
For future Googlers: This script is NOT legally valid anymore.
https://www.reuters.com/article/us-eu-court-cookies/internet-users-must-actively-consent-to-use-of-cookies-eu-court-rules-idUSKBN1WG3NF
[...] cookie consent must be specific and explicit and that clicking a button to participate in a game or browsing a website, and through that allowing cookies, was not enough.
Thanks @bavington and @timgerhard, this is simple and useful. I did a minor change as some people said, refreshing the page without closing the banner, it will just disappear, when createCookie function is called I create the cookie with a different value let's say "off" so if you reload the page function checkCookie looks for specific value, since it is different it will display the banner again when the user clicks to close the banner function removeMe is invoked so there I update the cookie value to "on".
Thanks.
Hi,
what should the following code do?
if(window.dropCookie){ document.cookie = name+"="+value+expires+"; path=/"; }
Can't find a dropCookie property on the window object.
Best regards.