Giter Site home page Giter Site logo

redboss1 / jquery.cookiefy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kmarryo/jquery.cookiefy

0.0 1.0 0.0 47 KB

Lightweight jQuery plugin to the EU cookie laws

Home Page: https://kmarryo.github.io/jquery.cookiefy/

License: MIT License

JavaScript 59.88% HTML 40.12%

jquery.cookiefy's Introduction

jquery.cookiefy

npm version Bower version

Lightweight jQuery plugin to the EU cookie laws

Demo: kmarryo.github.io/jquery.cookiefy

Installation

  1. Install via either bower, npm or downloaded files:

    1. via bower: bower install --save jquery.cookiefy
    2. via npm: npm install --save jquery.cookiefy
    3. via CDN (jsDelivr)
    4. via downloaded files
  2. Include jquery.cookiefy in your HTML.

    1. When using bower
    <script src="bower_components/jquery.cookiefy/dist/jquery.cookiefy.min.js"></script>
    1. When using npm
    <script src="node_modules/jquery.cookiefy/dist/jquery.cookiefy.min.js"></script>
    1. When using CDN
    <script src="//cdn.jsdelivr.net/jquery.cookiefy/1.0/jquery.cookiefy.min.js"></script>
    1. When using downloaded files
    <script src="YOUR_PATH/jquery.cookiefy.min.js"></script>

Usage

$('body').cookiefy();

Optional Parameters

Define your own text and styles for the eu-cookie warning.

Name Default Sample Description
displayedHtml warning text* You can insert your own cookie warning
text, e.g.with a link to your cookie policy site
closeButtonUrl close-btn.png Change the close button. Valid parameters:
relative/absolute image url or base64 string
backgroundColor #bebebe tomato Changes the background-color of the
cookie-warning
color #000 #fff Sets the color.
fontFamily Helvetica Sets the font-family
fontSize 1.25em Sets the font-size.
borderTop 1px solid #000 2px dotted green Sets the border-top value
borderTop 1px solid #000 2px dotted green Sets the border-top value
zIndex 50 130 Set the z-index value of the cookie warning container
devMode false true On true no cookie will be set and the warning
shows up every time you open the page

*We use cookies to ensure that we give you the best experience on our website. If you continue, you agree with <strong>our cookie policy</strong>.

Example

$('body').cookiefy({
    backgroundColor: 'dimgray',
    color: 'ghostwhite',
    fontFamily: 'Helvetica',
    fontSize: '1rem',
    borderTop: '1px solid #000',
    closeButtonUrl: 'https://cdn3.iconfinder.com/data/icons/interface/100/close_button_1-512.png'
});

Customize via CSS

You can style this three css ids:

  • #cookiefy_bar (complete cookie message div)
  • #cookiefy_cookie-text
  • #cookiefy_close (close button)

License

MIT

jquery.cookiefy's People

Contributors

johnnythetank avatar kmarryo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.