Cookie Law Script - Help

Use this script to easily comply with the cookie law.

Usage

Just include this script at the end of your page:

<script src="http://common.qoob.io/scripts/cookielaw/qoob.cookielaw.min.js"></script>

Dependencies

This script requires jQuery to be already loaded in the page. If, for whatever reason, you are not already using it, just include this script before the main one.

<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>

Options

If you want to customize the script's behaviour, just declare a variable before linking the main script, like this:

$cookielaw = {
  domain: 'custom.domain.name', // CUSTOM DOMAIN FOR WHICH THE COOKIE WILL BE VALID, USEFUL FOR MULTI-DOMAIN SITES, DEFAULTS TO THE CURRENT DOMAIN
  culture: 'it', // CUSTOM CULTURE TO USE DIFFERENT SETTINGS (SEE LATER), DEFAULT = 'it'
  message: { // CUSTOM MESSAGES FOR THE BAR, BASED ON CURRENT CULTURE
    it: 'Italian custom text here (in HTML), including the <a href="#">policy link</a>',
    en: 'English custom text here (in HTML), including the <a href="#">policy link</a>'
  },
  policyUrl: { // URL OF THE POLICY TEXT TO BE LOADED IN THE POPOVER, BASED ON CURRENT CULTURE
    it: 'http://common.qoob.io/scripts/cookielaw/policy/it.min.html',
    en: 'http://common.qoob.io/scripts/cookielaw/policy/en.min.html'
  },
  policyHRef: { // IF SPECIFIED, THE POLICY LINK WILL NOT SHOW A POPOVER BUT LOAD THE SPECIFIED URL, BASED ON CURRENT CULTURE
    it: 'http://www.google.com',
    en: 'http://www.google.com'
  },
  policyHRefTarget: '_blank', // CUSTOM TARGET FOR THE POLICY LINK, IF policyHRef IS SPECIFIED. DEFAULT = same page
  autoAcceptOnScroll: false, // AUTO-ACCEPT ON SCROLL. DEFAULT = false
  autoAcceptOnClickTo: selector/element(s), // AUTO-ACCEPT WHEN CLICKING ON THESE ELEMENTS. IT CAN BE OF TYPE HTML ELEMENT(S), JQUERY ELEMENT(S) OR A SELECTOR (STRING). DEFAULT = false
  autoRefreshOnAccept: false, // AUTO-REFRESH CURRENT PAGE ON ACCEPTING. DEFAULT = false
  position: 'top'/'bottom', // THE POSITION OF THE BANNER. DEFAULT = 'bottom'
}

Authors

Alby & Njy