Giter Club home page Giter Club logo

age-check's Introduction

age-check

A simple plugin that verifies if a user is old enough to enter your site.

You can easily customize the plugin with options and it uses sessionStorage (or localStorage or cookies) to keep from popping up again.

The modal box is responsive and uses an external CSS for easy styling.

Usage

Add inside document ready: $.ageCheck()

Options

  • minAge (Age to validate against)
  • redirectTo (URL to redirect when successful)
  • title (Title text above the prompt)
  • copy (Paragraph text below the title)
  • success (Callback to be called on successful validation, takes no arguments)
  • successMsg {header (Header on top of success message), body (text for success message)}
  • underAgeMsg (Message when user didn't pass age requirements)
  • underAge (Callback to be called on failed validation, takes no arguments)
  • errorMsg {invalidDay (message for invalid day entered), invalidYear (message for invalid year entered)}
  • storage (sessionStorage, localStorage, or cookie -- sessionStorage is the default)
  • storageExpires (number of days to store the cookie, ONLY VALID for cookie storage method)

To Minify JS + CSS

  • npm install gulp
  • npm install gulp-minify --save-dev
  • npm install gulp-clean-css --save-dev
  • npm install gulp-rename --save-dev
  • run gulp compress

alt tag

Click http://michaelsoriano.com/jquery-plugin-check-user-age/ for instructions and options

and

Click https://cdn.rawgit.com/michaelsoriano/age-check/master/index.html for demo

age-check's People

Contributors

clintoncrick avatar datashaman avatar fearlessflyer avatar g4mr avatar michaelsoriano avatar michaelthessel avatar oranges13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

age-check's Issues

Bailout button

Michael,
How can a 'bailout' or 'Exit' button be added to your script so it does not get hung-up on the missing invalid month/day/year entry? I've added a new button (next to the submit button) so users can Exit the age verification (they will be directed to http://www.disney.com/) all together. However, the screen is getting stuck on the wrong Month/Day/Year screen and not going to the redirect. Thanks in advance for any assistance you can provide.

Feature Request: Remember me

We love this library and it's super useful. However, it has two downsides for our implementation.

If we use sessionStorage the user is prompted for an age check every time they revisit our page after closing their browser. If we use localStorage, they're potentially only ever prompted once, and never again until their browser decides to remove that localStorage value.

We'd love a way to have a limited time of remembering before they're prompted again; not every time but not never.

I can work on submitting a PR that adds cookie storage with configurable expiration if that is something deemed a worthwhile effort. Let me know if this feature would be useful.

Potential for class conflict

The generic class name used to get the values of the input before validation could cause a conflict on a page where the classes are already in use.

In my site, for example, the day class was already in use so the validation will intermittently fail.

IE11

Mike,
This has been brought up on the Q/A's of your site with no resolution. I've tested your demo on every installed browser and IE11 is the only one not showing the Age Checker popup. I checked IE11's settings and found all were set to the 'default' settings. I understand you have tested IE11 and Age Checker with no issues... so, what settings beyond this browser 'default' settings are you using. I've checked that Popup Blocker is not active and Script options are set to allow Javascript. Thanks in advance for your assistance.
2018-03-16_2136

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.