EU Cookie Law Notice Plugin For Bootstrap 4 – Cookie-Alert

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

Preview:

EU Cookie Law Notice Plugin For Bootstrap 4 – Cookie-Alert

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> &#x1F36A; 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

You Might Be Interested In:


5 thoughts on “EU Cookie Law Notice Plugin For Bootstrap 4 – Cookie-Alert

  1. Dominik

    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?

    Reply
  2. Jordan Mullen

    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?

    Reply
  3. Stefan Boll

    The new GDPR update forces to decline / agree / adjust the cookies settings.
    Can you udpate your script?

    Reply

Leave a Reply