New options and improvements for the CookieBar plugin

We've recently had a flurry of new CookieBar users from Italy, where laws surrounding cookies have been implemented.

As a result of dozens of requests, the following two features have been added:

  1. acceptOnScroll - If set to 1 or greater, when the user scrolls that number of pixels up or down the page, they will automatically accept cookies.
  2. renewOnVisit - If set to true, whenever someone revisits your website, the cookie set by CookieBar will be renewed for a year.

The structure of the CookieBar code has also been improved, and there are another two new options as a result:

  1. acceptFunction - Allows you to set a javascript function to run when the user accepts cookies
  2. declineFunction - Allows you to set a javascript function to run when the user declines cookies

The above two options can be used to load iframes and other code which could result in cookies being saved or removed from a user's computer.

Thank you to everyone for your requests and continued use of CookieBar. It's amazing to see just how popular it has become!

Posted by Ant on the 8th June 2015 at 2:28pm. (2 comments)

Tags: jquery, javascript, cookiebar, tools


  • Stefano, 11th June 2015 at 8:52am:

    I have an error on acceptOnScroll with false (not function).

    Resolve with:

    line 143
    if(!isNaN(options.acceptOnScroll)) -> if(options.acceptOnScroll)

    line 176
    if(!isNaN(options.acceptOnScroll)) -> if(options.acceptOnScroll)

    • Ant, 11th June 2015 at 12:03pm:

      Thanks for spotting that error and providing a fix. Silly mistake on my part! I've updated the CookieBar download with this fix.

Post a comment

Fill out the form below to add a comment.

  1. Captcha field =