Sticky EU Cookie Law Notification Plugin with jQuery - herbyCookie

File Size: 11.5 KB
Views Total: 1686
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Sticky EU Cookie Law Notification Plugin with jQuery - herbyCookie

herbyCookie is a simple, customizable jQuery plugin that displays an animated EU-implied cookie disclaimer bar at the bottom of the webpage and stores the 'Accept' state in the local storage using HTML5 web storage API.

How to use it:

1. Add jQuery library and the jQuery herbyCookie plugin's script to your webpage.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="herbyCookie.js"></script>

2. Initialize the plugin to display an EU coolie disclaimer bar that always stays at the bottom of the webpage.

$(document).herbyCookie({/*OPTIONS*/});

3. Customize the plugin.

// 'dark' or 'light'
style: "dark",

// Text for Accept button
btnText: "Got it!",

// Policy text
policyText: "Privacy policy",

// Custom text
text: "This site uses cookies to store information on your computer.",

// Disable page scroll
scroll: false,

// expire days
expireDays: 30,

// Link to your policy page
link: "/policy.html"

Change log:

2015-11-11

  • Add "expireDays" option.
  • Set console error for invalid options.
  • Change localStorage content to JSON array.
  • Bug fix and performance improvment.

This awesome jQuery plugin is developed by paolobasso99. For more Advanced Usages, please check the demo page or visit the official website.