cookie consent bar message - Download Sticky Cookie Consent Bar Plugin - cookieMessage.js

Download Sticky Cookie Consent Bar Plugin – cookieMessage.js

Posted on

This time I will share jQuery Plugin and tutorial about Sticky Cookie Consent Bar Plugin – cookieMessage.js, hope it will help you in programming stack.

cookie consent bar message - Download Sticky Cookie Consent Bar Plugin - cookieMessage.js
File Size: 26.5 KB
Views Total: 9036
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The cookieMessage.js JQuery plugin lets you create a sticky Cookie Consent Bar on the bottom of the webpage to make your web app comply with the GDPR and European cookie law.

How to use it:

1. Include the minified version of the cookieMessage.js plugin after loading jQuery JavaScript library.

2         integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
3         crossorigin="anonymous">
4 </script>
5 <script src="dist/jquery.cookieMessage.min.js"></script>

2. Initialize the plugin and define the message to inform your users that your site has cookies. That’s it.

1 $.cookieMessage({
2   'mainMessage': 'This website uses cookies. By using this website you consent to our use of these cookies. For more information visit our <a href="https://www.jqueryscript.net/privacy/">Privacy Policy</a>. '
3 });

3. Customize the Accept button.

1 $.cookieMessage({
2   'mainMessage': 'This website uses cookies. By using this website you consent to our use of these cookies. For more information visit our <a href="https://www.jqueryscript.net/privacy/">Privacy Policy</a>. ',
3   'acceptButton': 'Got It!'
4 });

4. Customize the appearance of the Cookie Consent Bar.

1 $.cookieMessage({
2   backgroundColor: '#666',
3   fontSize: '14px',
4   fontColor: 'white',
5   btnBackgroundColor: '#f2a920',
6   btnFontSize: '11px',
7   btnFontColor: 'white',
8   linkFontColor: '#ffff00'
9 });

5. Set the cookie name and the time the cookie expires.

1 $.cookieMessage({
2   expirationDays: 20,
3   cookieName: 'cookieMessage'
4 });

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

source : jquery.net