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

Category: Javascript | October 29, 2018
Author: Wruczek
Views Total: 3,007
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:

Leave a Reply