Skip to content
Drop-in jQuery plugin for implied to consent to the EU Cookie directive (UK)
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Drop-in jQuery plugin for implied consent to the EU Cookie directive (UK implementation).

Compliance in one file and $.cookieConsent(). Please fork and contribute!

Contains jquery.cookie.

This plugin was originally created for The Higgs Design Co.


<script src="//"></script>
<script src="jquery.cookieConsent.min.js"></script>
  $(function () {


You can configure the plugin by passing in an object.

    mode: 'default', // Default, tab or popover
    persistence: 'heavy', // Light (hides after viewed once) or Heavy (requires user to interact/close)
    color: {
      main: '#29f', // Border & icon color
      bg: '#fff', // Background color
      popover: 'rgba(0,0,0,.3)', // Popover background color
      text: '#444' // Text color
    font: '12px Tahoma, sans-serif', // Font size & family
    width: 'auto', // Width of the banner
    maxWidth: '50%', // Responsiveness
    link: {
      cookies: "", // The cookies link
      policy: "link/to/your/policy" // The cookie policy link
    content: {
      // Allows you to specify the text content of the plugin, using an aray & object based syntax (explained below)
      // You can also pass in a string, eg: "<p>Read our <a href='/policy.html'>policy</a></p>"
        ['strong', {content: 'This site uses '},
          ['a', {href: '', content: 'cookies.'}]
        ['p', {content: "We won't share your data with any third parties."}]

If you'd like to configure the text, you can use the syntax described below:

// The cookieConsent element
// Sytanx is:
//  [element [string], attributes [object], childElements... [arrays]]
// Special attributes:
//  content - inserted as text content of the element
//  css - object run through jQuery's css method

// For example:
var myElement =
['div', {id: "my-element"},
  ['p', {css: {color: "red"}, content: "I love red paragraphs"}],
  ['a', {href: "", content: "Click me!"}]


MIT License

Copyright (C) Tom Ashworth 2012

Something went wrong with that request. Please try again.