
cookies-enabler.js is a simple yet fully configurable JavaScript library for preventively blocking third-party cookies installed by js and comply with the EU cookie law.
Basic usage:
Load the required stylesheet in the head section of the document.
<link rel="stylesheet" href="stylesheets/cookies-enabler.css">
Load the cookies-enabler.js script at the bottom of the document.
<script src="cookies-enabler.js"></script>
Initialization.
COOKIES_ENABLER.init({
// OPTIONS HERE
});Default options available.
COOKIES_ENABLER.init({
scriptClass: 'ce-script',
iframeClass: 'ce-iframe',
acceptClass: 'ce-accept',
dismissClass: 'ce-dismiss',
bannerClass: 'ce-banner',
bannerHTML:
'<p>This website uses cookies. '
+'<a href="#" class="ce-accept">'
+'Enable Cookies'
+'</a>'
+'</p>',
eventScroll: false,
scrollOffset: 200,
clickOutside: false,
cookieName: 'ce-cookie',
cookieDuration: '365',
iframesPlaceholder: true,
iframesPlaceholderHTML:
'<p>To view this content you need to'
+'<a href="#" class="ce-accept">Enable Cookies</a>'
+'</p>',
iframesPlaceholderClass: 'ce-iframe-placeholder',
// Callbacks
onEnable: '',
onDismiss: ''
});Changelog:
01/04/2018
- Fixed postscribe issue – call only if defined
05/26/2018
- v0.1.2







