Author: | Wruczek |
---|---|
Views Total: | 27,439 views |
Official Page: | Go to website |
Last Update: | October 29, 2018 |
License: | MIT |
Preview:

Description:
Cookie-Alert is a pure JavaScrip plugin that creates a cookie notice bar using Bootstrap 4 alert component to make your webpage to comply the European cookie law. The plugin stores the user selection in the browser cookies once you click the ‘I Agree’ button so that the cookie notice bar will NOT appear in next visit.
How to use it:
Include the necessary Bootstrap 4 stylesheet and the Cookie-Alert’s CSS file in the web page.
<!-- Bootstrap 4 --> <link rel="stylesheet" href="/path/to/bootstrap.min.css"> <!-- cookiealert.css --> <link rel="stylesheet" href="cookiealert.css">
Include the JavaScript file cookiealert-standalone.js
at the bottom of the web page.
<script src="cookiealert-standalone.js"></script>
Add your own message to the cookie alert bar as these:
<div class="alert alert-dismissible text-center cookiealert" role="alert"> <div class="cookiealert-container"> <b>Do you like cookies?</b> 🍪 We use cookies to ensure you get the best experience on our website. <a href="http://cookiesandyou.com/" target="_blank">Learn more</a> <button type="button" class="btn btn-primary btn-sm acceptcookies" aria-label="Close"> I agree </button> </div> </div>
Changelog:
10/29/2018
- Removed unnecessary DIV
Same code checked in two browsers: It works perfectly in Firefox but Chrome does not show the cookie alert at all. Any solution for this problem?
The code is now not working, I assume it’s something with Bootstrap 4, but the css isn’t showing properly. Is there any updates you can post for us?
Thank you very much, I just added it to my Opencart shop. It was really done in no time and works flawless.
It’s perfectly working for me
The new GDPR update forces to decline / agree / adjust the cookies settings.
Can you udpate your script?