GDPR Cookie Consent JavaScript Plugin

GDPR Cookie Consent JavaScript Plugin 01

GDPR Cookie Consent JavaScript plugin makes your site and blog to be fulfilled with the European cookie and General Data Protection Regulation (GDPR). This small jQuery plugin adds a simple Cookie Bar with info about cookies which is being used.

GDPR JavaScript Plugin is a simply adapted that contains the ingenious multilingual function. The plugin is used to create a multi-language and customizable cookie permission message to informs visitors that your site uses cookies. New language for Cookie Bar. can be added. You just need to use this addTranslation method.

GDPR Cookie Consent JavaScript Multilingual Plugin

Installation

The easiest ways to download and install this plugin.

Install Via npm

$ npm i kovarp-jquery-cookiebar

Clone repository

$ git clone https://github.com/kovarp/jquery.cookieBar

Add to page

Link plugin CSS file in page head

<link rel="stylesheet" href="jquery.cookieBar.min.css">

Link plugin script file after jQuery

Generate CSS3 Animation Tool with Bounce.js
<script src="jquery.min.js"></script>
<script src="jquery.cookieBar.js"></script>

Using

Examples of plugin using.

Default initialization

$(function() {
	$.cookieBar();
});

Initialization with custom options

$(function() {
	$.cookieBar({
		style: 'bottom'
	});
});

Options

style - Define style of display cookie bar on page

default: 'top'
options: 'top', 'bottom', 'bottom-left', 'bottom-right'
wrapper - Wrapper, where the cookie bar will prepended

default: 'body'
options: string
expireDays - Number of days, when the cookies will expires

default: 365
options: integer
infoLink - URL for "more info link"

default: 'https://www.google.com/policies/technologies/cookies/'
options: string
infoTarget - Targer for "more info link"

default: '_blank'
options: '_blank', '_self', '_parent', '_top'
language - Language of the cookie bar

default: $('html').attr('lang') || 'en'
options: 'ISO 639-1 Language Code'
The default value means, that the plugin detect automatically language from html lang attribute.

privacy - Show privacy protection button (GDPR)

default: false
options: false, 'popup', 'bs_modal', 'link'
privacyTarget - Target attribute for "privacy button link"

default: '_blank'
options: '_blank', '_self', '_parent', '_top'
privacyContent - Content for privacy button

default: null
options: null, 'custom HTML', 'Bootstrap modal ID', 'url'

Languages support

You can add new language for Cookie Bar. Just use this addTranslation method.

Transit – CSS Transitions & Transformations for jQuery
$(function() {
	$.cookieBar('addTranslation', 'de', {
		message:	'Zur Bereitstellung von Diensten verwenden wir Cookies. Durch die Nutzung dieser Website stimmen Sie zu.',
		acceptText:	'OK',
		infoText:	'Mehr Informationen',
		privacyText:	'Datenschutz'
	});
});
Then, you can initialize the Cookie Bar with your own language.

$(function() {
	$.cookieBar({
		language: 'de'
	});
});

File Info.

File Size16.90 KB
Last Update5 Months Ago
Published Date3 Years Ago
LicenseMIT