#jquery-check
The powerful jQuery plugin that provide a easy used and customized checkbox. Project page and demos
Download: jquery-check-master.zip
- callbacks to handle changes
- Lightweight size — 1 kb gzipped
- Saves changes to textarea, works carefully with any selectors
Import this libraries:
- jQuery
- jquery-check.min.js
And CSS:
- jquery-check.css - desirable if you have not yet connected one
Create base html element:
<ul>
<li>
<input class="radio" type="radio" name="radiobox" id="male-1" value="male" />
<label for="male-1" >Male</label>
</li>
<li>
<input class="radio" type="radio" name="radiobox" id="male-2" value="female" />
<label for="male-2" >Female</label>
</li>
<li>
<input class="radio" type="radio" name="radiobox" id="male-3" value="male" disabled="disabled" />
<label for="male-3" >checked disable</label>
</li>
<li>
<input class="radio" type="radio" name="radiobox" id="male-4" value="male" disabled="disabled" />
<label for="male-4" >checked disable</label>
</li>
</ul>
Initialize check:
$('.radio').check({skin: 'skin-1'});
Or initialize check with custom settings:
$(".radio").check({
namespace: 'check',
skin: null,
state: 'enabled',
checked: 'checked',
type: 'checkbox', // checkbox , radio
onChange: function() {}
});
{
//Optional property, set a namspace for css class, for example, we
//have <code>.check_active</code> class for active effect, if
//namespace set to 'as-check', then it will be <code>.as-check_active
namespace: 'check',
//Optional property, set transition effect, it works after you load specified skin file
skin: null,
//Optional property, set input's disabled state
state: enable,
//Optional property, set input's checked property,if the value is 'checked',this input will be checked
checked: 'checked',
//Optional property, set input's type
type: 'checkbox',
//callback after input's state is changed
Onchange: function(){}
}
jquery check has different methods , we can use it as below :
// set input's state
$(".radio").check("set");
// remove disabled state
$(".radio").check("enable");
// change input's state to disabled
$(".radio").check("disable");
change
: trigger when input's checked property changeddisabled
: trigger when input set to disabledenabled
: trigger when input set to enabled
how to use event:
$(document).on('change', function(event,instance) {
// instance means current check instance
// some stuff
});
jquery-tabs is verified to work in Internet Explorer 7+, Firefox 2+, Opera 9+, Google Chrome and Safari browsers. Should also work in many others.
Mobile browsers (like Opera mini, Chrome mobile, Safari mobile, Android browser and others) is coming soon.
Version | Notes |
---|---|
... | ... |
jQuery-check plugin is released under the GPL licence.