Simple EU Cookie Law Notice Popup Plugin With jQuery - Qookies
File Size: | 25.3 KB |
---|---|
Views Total: | 3000 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
Qookies is a jQuery plugin that displays your cookies disclaimer in a popup window to make your website comply with the EU cookie law.
How to use it:
1. Place the core style sheet and a theme CSS of your choice into the header of the document.
<link href="qk-default.css" rel="stylesheet"> <link href="qk-theme-default.css" rel="stylesheet">
2. Create an empty container for the cookies disclaimer popup.
<div class="qookies"></div>
3. Place jQuery library and other required JavaScript files at the end of the document.
<script src="//code.jquery.com/jquery.min.js"></script> <script src="min/js/js.cookie.js"></script> <script src="min/js/qookies.js"></script>
4. Customise the notice text and link to your cookie policy page like this:
var lang= { title:"Privacy Policy", description:"<p> This website uses cookies to ensure you get the best experience on our website. </p>", link:{ text:"Read More", url:"//www.jqueryscript.net/privacy/" }, buttons:{ accept:"Got it!", cancel:"Cancel" } };
5. Call the function on the DIV container you just created and done.
$('.qookies').qookies();
6. All customization options with default values.
$('.qookies').qookies({ theme: 'theme-default', position: 'bottom-right', expires: 30, // 30 days path: '/', value: '1', cookieName: 'qookies-accepted', link: { text: lang.link.text, url: lang.link.url }, });
Change log:
2016-05-25
- added more options
This awesome jQuery plugin is developed by quanhub. For more Advanced Usages, please check the demo page or visit the official website.