jquery.cookie-consent is a simple jQuery plugin to request consent to use cookies. An easy-to-use and highly customizable cookie consent bar that informs your visitors of the use of cookies on your website.
More features:
- Ensure that you comply with European Cookie Law
- Personalized cookie notification message.
- Custom CSS Styles.
- Cookie consent information is saved in cookies or web storage.
- The job is run after the user accepts the policy.
Must Read: A Modal Dialog Bootstrap Cookie Banner Consent Settings and Framework
How to make use of it:
1. Load the cookie-consent.js
the plugin after jQuery.
<script src="/path/to/cdn/jquery.min.js"></script> <script src="/path/to/dist/jquery.cookie-consent.min.js"></script>
2. Initialize the plugin to show a cookie consent bar on the web page.
$(function(){ $.cookieConsent(); });
3. Customize the cookie discover message.
$.cookieConsent({ message: 'This website uses cookies. Privacy Policy', });
4. Apply your styles to the cookie consent bar. In this instance, we will repair the cookie consent bar at the top of the web page.
$.cookieConsent({ style: "position: fixed; width:100%" });
5. Customize the cookie consent button.
$.cookieConsent({ consentMessage: "I understand", consentStyle: "", acceptClass: "cookieAccept", });
6. Determine the best way to save the cookie consent info.
$.cookieConsent({ // 10 years consentTime: 3650, // cookie, local, or session storage: "cookie", });
7. Enable the event mode.
$.cookieConsent({ testing: true });
8. Callback capabilities.
$.cookieConsent({ onInit: function(){ }, onConsent: function(){ }, onTemplate: function(){ console.log(this) }, });
See Demo And Download
Official Website(myspace-nu): Click Here
This superior jQuery/javascript plugin is developed by myspace-nu. For extra Advanced Usage, please go to the official website.