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.
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" > |
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.
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. Customize the Accept button.
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. Customize the appearance of the Cookie Consent Bar.
2 |
backgroundColor: '#666' , |
5 |
btnBackgroundColor: '#f2a920' , |
8 |
linkFontColor: '#ffff00' |
5. Set the cookie name and the time the cookie expires.
3 |
cookieName: 'cookieMessage' |
This awesome jQuery plugin is developed by desarrolladorninja. For more Advanced Usages, please check the demo page or visit the official website.