Universal cookie alert plugin, i18n ready, fully customizable. Depends on jQuery (works both on v1 and v2).
See a live demo.
Install and save the dependency with bower install bica-cookie-alert --save.
Clone this repository or download and uncompress a *.tar.gz release in your js directory.
Copy/paste this code into the <head> tag of your html page(s), just before your layout stylesheet.
<link rel="stylesheet" type="text/css" href="path-to-vendors/bica-cookie-alert/css/bica.min.css">Copy/paste this code at the bottom of your html page(s), just before </body> closing tag.
<!-- jQuery loaded from a cdn -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="path-to-vendors/bica-cookie-alert/js/bica.min.js"></script>
<script>bica.init({ <options> })</script>Enjoy!
Options are passed as js object {…}.
May be inline, column or stack. Changes the way disclaimer and actions will appear.
Css color (default to #000).
Css color (default to #fff).
Css color (default to #666).
Css color (default to #ffffff). This option needs the #rrggbb full notation to work correctly. Combined with bgOpacity to achieve a custom transparent background color.
Float (default to 0.9). Combined with bgColor to achieve a custom transparent background color.
Integer (default to 1200). Number of milliseconds before the disclaimer show up.
String (default to <empty_string>). Specify the url to link the Learn more button. If no url is provided, the button will not appear.
String (default to en). Specify the fallback language.
String (default fetched right from html:lang attribute). (Supported languages: it, en, de).
Object (default it, en, de translations). Define view labels text.
- Lowered jQuery requirements to 1.4
- Removed async loads of translations, css and view
- Text injected via options
- Remove jQuery dependency.
Script is licensed under MIT license.