Giter Site home page Giter Site logo

jasonyost / checkground Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 584 KB

a simple jQuery plugin which replaces the default checkbox control with an easy to style div element

Home Page: http://jasonyost.github.io/checkground

JavaScript 44.61% HTML 14.59% CSS 40.80%

checkground's Introduction

checkground

Description

checkground is a simple jQuery plugin which replaces the default checkbox control with an easy to style div element. checkground hides the original element, and updates the checked property based on the state of the background
of the checkground element.

build status

Installation and usage

Download or clone the repo and include the jquery.checkground.min.js file in your html. checkground is a jQuery plugin so be sure it is loaded after jQuery

<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="dist/jquery.checkground.min.js" charset="utf-8"></script>

checkgound can then be called on the desired input(s)

$("input[type=checkbox]").checkground();

Parameters

$("input[type=checkbox]").checkground({
  debug: false // if set to true will log console messages from checkground
});

Styling

checkground does not add any inline CSS other than to hide the original element you will need to provide styles for the control in your own stylesheet or use the demo stylesheet

.checkground-wrapper{
  width: 25px;
  height: 25px;
  border: 2px solid #13594d;
  padding: 3px;
}

.checkground-checked{
  background-color: #abc;
}

Form interactions

checkground updates the original hidden field with the checked property as it changes, the change event of the input is bound to update the display of the control on change.

Thanks

Based on the excellent jquery-boilerplate/jquery-boilerplate

checkground's People

Stargazers

 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.