It´s a very lightweight, adjustable and easy-to-use plugin for the EU-law cookie warning.
Cookies are small pieces of data which are stored on the computers or mobile devices of site visitors. They are used to gather information about the site visitor. Also it tells the computer if the user already visited a specific site once before so he e.g. has not to sign up every time he visits the site again.
The EU Cookie law states, that site owners have to inform visitors about their usage of cookies. It was created to save and protect the privacy of site visitors.
If you are using cookies on your website, you have to inform them about your usage of cookies. jquery.cookiefy helps you fulfill the restrictions of the new EU cookie law. You only have to adust the predefined parameters to your custom needs.
Benefits of using jquery.cookiefy
bower install --save jquery.cookiefy
npm install --save jquery.cookiefy
<script
src="bower_components/jquery.cookiefy/dist/jquery.cookiefy.min.js"></script>
<script
src="node_modules/jquery.cookiefy/dist/jquery.cookiefy.min.js"></script>
<script
src="//cdn.jsdelivr.net/jquery.cookiefy/1.0/jquery.cookiefy.min.js"></script>
<script src="YOUR_PATH/jquery.cookiefy.min.js"></script>
$('body').cookiefy();
Name | Default | Sample | Description |
---|---|---|---|
displayedHtml |
warning text* | You can insert your own cookie warning text, e.g.with a link to your cookie policy site. | |
closeButtonUrl |
'img/close.png' |
Defines the URL of the close icon. It can be a relative or absolute URL or a base64-encoded image. | |
backgroundColor |
#bebebe |
tomato |
Changes the background-color of the cookie-warning. |
color |
#000 |
red |
Sets the color. |
fontFamily |
Helvetica |
Sets the font-family | |
fontSize |
1.25em |
Sets the font-size. | |
borderTop |
1px solid #000 |
2px dotted green |
Sets the border-top value. |
zIndex |
50 |
130 |
Set the z-index value of the cookie warning container |
cssPrefix |
cookiefy_ |
my-own-page_ |
Set the css id prefix for all created DOM elements and for the cookie name |
devMode |
false |
On true no cookie will be set and the warning shows up every time you open
the page.
|
*Default warning text: We use cookies to ensure that we give you the best experience on our
website.
If you continue, you agree with <strong>our cookie policy</strong>.
$('body').cookiefy({
backgroundColor: 'dimgray',
color:'ghostwhite',
fontFamily: 'Helvetica',
fontSize: '1rem',
borderTop: '1px solid #000'
});