Version 1.0.0
Generate a simple cookie bar in single line of code.
- Super lightweight, only 3KB
- Responsive design
- Minimal and ease to use
@louisho5
To include the plugin in your code:
<script src="cookieBar.js"></script>
or
<script src="cookieBar.min.js"></script>
Works in IE11+, Edge 12+, Chrome 29+, Safari 9+, Firefox 28+.
index.html:
<div id="cookieBar"></div>
<script src="cookieBar.min.js"></script>
<script>
new cookieBar();
</script>
There are 5 optional parameters in this plugin:
new cookieBar({
selector: "#cookieBar",
message: 'We use cookies to ensure that we give you the best experience on our website. Please find more information <a href="#" target="_blank">here</a>.',
button: 'ACCEPT',
theme: '#666666',
expire: 24 //By default it will expire in 24 hours, you can set your own duration e.g. 24*7 for 7 days
});
This plugin is under the MIT license.