Press "Enter" to skip to content

Simple jQuery Plugin for Add Multi-language Cookie Notice Bar

jquery.cookieBar plugin, which adds a simple cookie bar with information about the use of cookies. The plugin is simply modified and has a smart multi-language function.

jquery cookieBar plugin makes it easy to create a customizable, multilingual consent message for cookies to notify your visitors of your site’s use of cookies.

cookie consent code html, cookies accept script, cookie consent popup javascript, cookie popup jquery example, simple cookie notification bar, free cookie plugin, cookie notice js

How to make use of it:

1. Load the principle stylesheet jquery.cookieBar.min.css within the header of the doc.

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

2. Load jQuery library and the principle JavaScript jquery.cookieBar.min.js on the finish of the doc.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<script src="jquery.cookieBar.min.js"></script>

3. Create a default cookie discover bar that can be keep on the top of the webpage.

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

4. Change the place of the cookie notice bar.

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

5. Don’t overlook switching the URL of your Privacy Policy web page.

$(function() {
  $.cookieBar({
    infoLink:   ' ',
    infoTarget: '_blank'
  });
});

6. Customize the Cookies Expiration Date.

$(function() {
  $.cookieBar({
    expireDays: 365
  });
});

7. Specify the place the cookie discover bar needs to be appended to.

$(function() {
  $.cookieBar({
    wrapper: 'body'
  });
});

8. Change the language of the cookie consent message. Supported language: ‘en’, ‘de’, ‘cs’, ‘sk’, ‘ru’, ‘ua’, ‘pl’, ‘es’.

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

9. Add your individual language strings similar to this:

translation['en'] = {
  message:  'We use cookies to provide our services. By using this website, you agree to this.',
  acceptText: 'OK',
  infoText: 'More information'
};

translation['de'] = {
  message:  'Zur Bereitstellung von Diensten verwenden wir Cookies. Durch die Nutzung dieser Website stimmen Sie zu.',
  acceptText: 'OK',
  infoText: 'Mehr Informationen'
};

translation['cs'] = {
  message:  'K poskytování služeb využíváme soubory cookie. Používáním tohoto webu s&nbsp;tím souhlasíte.',
  acceptText: 'V pořádku',
  infoText: 'Více informací'
};

translation['sk'] = {
  message:  'Na poskytovanie služieb využívame súbory cookie. Používaním tohto webu s&nbsp;tým súhlasíte.',
  acceptText: 'V poriadku',
  infoText: 'Viac informácií'
};

10. Enable the GDPR privateness notice.

$(function() {
  $.cookieBar({

    // 'popup', 'bs_modal', 'link'
    privacy:        false,

    // target property
    privacyTarget:  '_blank',

    // 'custom HTML', 'Bootstrap modal ID', 'url'
    privacyContent: null
    
  });
});

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 detects automatically language from HTML lang attribute.

privacy – Show the 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'

Multi-language Cookie Notice Bar Plugin, jquery.cookieBar plugin/Github, jquery cookie consent


See Demo And Download

Official Website(kovarp): Click Here

This superior jQuery/javascript plugin is developed by kovarp. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.