jQuery cookie consent with jQuery JavaScript
# jquery.cookieMessage.js
JQuery plugin that shows and manages cookie authorization message for custom web pages.To use the plugin, add it to your html in the following manner after adding jQuery:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="path/to/jquery.cookieMessage.min.js"></script>
To put the plugin in operation, you only need to call the following function:<script type="text/javascript">
$.cookieMessage({
'mainMessage': 'Utilizamos cookies propias para garantizar la mejor experiencia a nuestros usuarios, elaborar información estadística y mejorar el rendimiento de nuestro sitio web. <br> Si clicas en <strong>Aceptar</strong> o continúas navegando, estarás aceptando los términos indicados en nuestra <a href="/path/to/politica-privacidad.html">política de cookies</a>. ',
'acceptButton': 'Aceptar',
});
</script>
You can customize the message with the following options:<script type="text/javascript">
$.cookieMessage({
mainMessage: "",
acceptButton: "Aceptar",
expirationDays: 20,
backgroundColor: '#666',
fontSize: '14px',
fontColor: 'white',
btnBackgroundColor: '#f2a920',
btnFontSize: '11px',
btnFontColor: 'white',
linkFontColor: '#ffff00',
cookieName: 'cookieMessage'
});
</script>
This pluging has been developed by the ninja developer.