Git Product home page Git Product logo

icheck's Introduction

Highly customizable checkboxes and radio buttons for jQuery and Zepto.

Refer to the iCheck website for examples.

Note: iCheck v2.0 is on the way, it got a huge performance boost, many new options and methods. It's in a release candidate state, so you may try to use it. Feel free to submit an issue if you find something not working.

Skins

Features

  • Identical inputs across different browsers and devices — both desktop and mobile
  • Touch devices support — iOS, Android, BlackBerry, Windows Phone, Amazon Kindle
  • Keyboard accessible inputsTab, Spacebar, Arrow up/down and other shortcuts
  • Customization freedom — use any HTML and CSS to style inputs (try 6 Retina-ready skins)
  • jQuery and Zepto JavaScript libraries support from single file
  • Screenreader accessible inputsARIA attributes for VoiceOver and others
  • Lightweight size — 1 kb gzipped

How it works

iCheck works with checkboxes and radio buttons like a constructor. It wraps each input with a div, which may be customized by you or using one of the available skins. You may also place inside that div some HTML code or text using insert option.

For this HTML:

<label>
  <input type="checkbox" name="quux[1]" disabled>
  Foo
</label>

<label for="baz[1]">Bar</label>
<input type="radio" name="quux[2]" id="baz[1]" checked>

<label for="baz[2]">Bar</label>
<input type="radio" name="quux[2]" id="baz[2]">

With default options you'll get nearly this:

<label>
  <div class="icheckbox disabled">
    <input type="checkbox" name="quux[1]" disabled>
  </div>
  Foo
</label>

<label for="baz[1]">Bar</label>
<div class="iradio checked">
  <input type="radio" name="quux[2]" id="baz[1]" checked>
</div>

<label for="baz[2]">Bar</label>
<div class="iradio">
  <input type="radio" name="quux[2]" id="baz[2]">
</div>

By default, iCheck doesn't provide any CSS styles for wrapper divs (if you don't use skins).

Options

These options are default:

{
  // 'checkbox' or 'radio' to style only checkboxes or radio buttons, both by default
  handle: '',

  // base class added to customized checkboxes
  checkboxClass: 'icheckbox',

  // base class added to customized radio buttons
  radioClass: 'iradio',

  // class added on checked state (input.checked = true)
  checkedClass: 'checked',

    // if not empty, used instead of 'checkedClass' option (input type specific)
    checkedCheckboxClass: '',
    checkedRadioClass: '',

  // if not empty, added as class name on unchecked state (input.checked = false)
  uncheckedClass: '',

    // if not empty, used instead of 'uncheckedClass' option (input type specific)
    uncheckedCheckboxClass: '',
    uncheckedRadioClass: '',

  // class added on disabled state (input.disabled = true)
  disabledClass: 'disabled',

    // if not empty, used instead of 'disabledClass' option (input type specific)
    disabledCheckboxClass: '',
    disabledRadioClass: '',

  // if not empty, added as class name on enabled state (input.disabled = false)
  enabledClass: '',

    // if not empty, used instead of 'enabledClass' option (input type specific)
    enabledCheckboxClass: '',
    enabledRadioClass: '',

  // class added on indeterminate state (input.indeterminate = true)
  indeterminateClass: 'indeterminate',

    // if not empty, used instead of 'indeterminateClass' option (input type specific)
    indeterminateCheckboxClass: '',
    indeterminateRadioClass: '',

  // if not empty, added as class name on determinate state (input.indeterminate = false)
  determinateClass: '',

    // if not empty, used instead of 'determinateClass' option (input type specific)
    determinateCheckboxClass: '',
    determinateRadioClass: '',

  // class added on hover state (pointer is moved onto input)
  hoverClass: 'hover',

  // class added on focus state (input has gained focus)
  focusClass: 'focus',

  // class added on active state (mouse button is pressed on input)
  activeClass: 'active',

  // adds hoverClass to customized input on label hover and labelHoverClass to label on input hover
  labelHover: true,

    // class added to label if labelHover set to true
    labelHoverClass: 'hover',

  // increase clickable area by given % (negative number to decrease)
  increaseArea: '',

  // true to set 'pointer' CSS cursor over enabled inputs and 'default' over disabled
  cursor: false,

  // set true to inherit original input's class name
  inheritClass: false,

  // if set to true, input's id is prefixed with 'iCheck-' and attached
  inheritID: false,

  // set true to activate ARIA support
  aria: false,

  // add HTML code or text inside customized input
  insert: ''
}

There's no need to copy and paste all of them, you can just mention the ones you need:

$('input').iCheck({
  labelHover: false,
  cursor: true
});

You can choose any class names and style them as you want.

Initialize

Just include icheck.js after jQuery v1.7+ (or Zepto [polyfill, event, data]).

iCheck supports any selectors, but handles only checkboxes and radio buttons:

// customize all inputs (will search for checkboxes and radio buttons)
$('input').iCheck();

// handle inputs only inside $('.block')
$('.block input').iCheck();

// handle only checkboxes inside $('.test')
$('.test input').iCheck({
  handle: 'checkbox'
});

// handle .vote class elements (will search inside the element, if it's not an input)
$('.vote').iCheck();

// you can also change options after inputs are customized
$('input.some').iCheck({
  // different options
});

Indeterminate

HTML5 allows specifying indeterminate ("partially" checked) state for checkboxes. iCheck supports this for both checkboxes and radio buttons.

You can make an input indeterminate through HTML using additional attributes (supported by iCheck). Both do the same job, but indeterminate="true" may not work in some browsers (like IE7):

indeterminate="true"
<input type="checkbox" indeterminate="true">
<input type="radio" indeterminate="true">

determinate="false"
<input type="checkbox" determinate="false">
<input type="radio" determinate="false">

indeterminate and determinate methods can be used to toggle indeterminate state.

Callbacks

iCheck provides plenty callbacks, which may be used to handle changes.

Callback name When used
ifClicked user clicked on a customized input or an assigned label
ifChanged input's "checked", "disabled" or "indeterminate" state is changed
ifChecked input's state is changed to "checked"
ifUnchecked "checked" state is removed
ifToggled input's "checked" state is changed
ifDisabled input's state is changed to "disabled"
ifEnabled "disabled" state is removed
ifIndeterminate input's state is changed to "indeterminate"
ifDeterminate "indeterminate" state is removed
ifCreated input is just customized
ifDestroyed customization is just removed

Use on() method to bind them to inputs:

$('input').on('ifChecked', function(event){
  alert(event.type + ' callback');
});

ifCreated callback should be binded before plugin init.

Methods

These methods can be used to make changes programmatically (any selectors can be used):

// change input's state to 'checked'
$('input').iCheck('check');

// remove 'checked' state
$('input').iCheck('uncheck');

// toggle 'checked' state
$('input').iCheck('toggle');

// change input's state to 'disabled'
$('input').iCheck('disable');

// remove 'disabled' state
$('input').iCheck('enable');

// change input's state to 'indeterminate'
$('input').iCheck('indeterminate');

// remove 'indeterminate' state
$('input').iCheck('determinate');

// apply input changes, which were done outside the plugin
$('input').iCheck('update');

// remove all traces of iCheck
$('input').iCheck('destroy');

You may also specify some function, that will be executed on each method call:

$('input').iCheck('check', function(){
  alert('Well done, Sir');
});

Feel free to fork and submit pull-request or submit an issue if you find something not working.

Comparison

iCheck is created to avoid routine of reinventing the wheel when working with checkboxes and radio buttons. It provides an expected identical result for the huge number of browsers, devices and their versions. Callbacks and methods can be used to easily handle and make changes at customized inputs.

There are some CSS3 ways available to style checkboxes and radio buttons, like this one. You have to know about some of the disadvantages of similar methods:

  • inputs are keyboard inaccessible, since display: none or visibility: hidden used to hide them
  • poor browser support
  • multiple bugs on mobile devices
  • tricky, harder to maintain CSS code
  • JavaScript is still needed to fix specific issues

While CSS3 method is quite limited solution, iCheck is made to be an everyday replacement covering most of the tasks.

Browser support

iCheck is verified to work in Internet Explorer 6+, 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, Silk and others) are also supported. Tested on iOS (iPad, iPhone, iPod), Android, BlackBerry and Windows Phone devices.

Changelog

October 10, 2020

  • iOS 13 support @markusbroman
  • Reformatted changelog @lasseeee
  • Fire change event when toggled @rafatmyo

March 03, 2014

  • Better HiDPI screens support @ddctd143

January 23, 2014 (v2.0 release candidate)

  • Three ways to set an options: global object (window.icheck), data attributes (<input data-checkedClass="checked") and direct JavaScript object ($(input).icheck({ options }))
  • Huge performance boost (takes less than 1s to customize 1000 inputs)
  • Minimized number of function calls (some slow jQuery functions are replaced with a faster vanilla alternatives without using any dependencies)
  • AMD module definition support (both for jQuery and Zepto)
  • Unblocked native events - iCheck 2.x doesn't stop your newly or past binded events from being processed
  • Pointer events support - full support for phones and tablets that use Windows OS (such as Lumia, HP tablets, desktops with a touch screen, etc)
  • WebOS and Firefox OS support
  • New methods: $(input).icheck('data') to get all the options were used for customization (also stores a current states values - checked, disabled and indeterminate), $('input').icheck('styler') to get a wrapper div (that's used for customization)
  • Better handling of the indeterminate state
  • Ability to set callbacks in three ways: global object, direct JavaScript object or using bind method ($(input).on(callback))
  • Ability to switch off some of the callbacks when you don't need them (global or per input)
  • Inline styles dropped - iCheck won't add any inline styles to the elements until it's highly needed (cursor or area option)
  • Fast click support - removes a 300ms click delay on mobile devices without any dependencies (iCheck compatible with the fastclick plugin), see the tap option
  • Ability to ignore customization for the selected inputs using init option (if set to false)
  • Optimized event bindings - iCheck binds only a few global events for the all inputs (doesn't increase on elements addition), instead of a couple for the each customized element
  • Doesn't store tons of arbitrary data (event in jQuery or Zepto cache), defines customized elements by specific classnames
  • Extra ins tag is dropped (less DOM modifications), iCheck wraps each input with a single div and doesn't use any extra markup for the any option
  • Optimized reflows and repaints on init and state changes
  • Better options handling - iCheck will never run a single line of JS to process an options that are off or empty
  • Ability to auto customize the ajax loaded inputs without using any extra code (autoAjax option, on by default)
  • Auto inits on domready using the specified selector (autoInit option) - searches for .icheck by default. Classnames can be changed using the window.classes object
  • Memory usage optimization - uses only a few amount of memory (works well on low-memory devices)
  • Betters callbacks architecture - these are fired only after changes are applied to the input
  • Ability to set a mirror classes between the inputs and assigned labels using the hoverLabelClass, focusLabelClass, activeLabelClass, checkedLabelClass, disabledLabelClass and indeterminateLabelClass options (mirror option should be set to true to make this happen)
  • Fixes some issues of the mobile devices
  • Fixes the issues of the wrapper labels, that loose a click ability in some browsers (if no for attribute is set)
  • Some other options and improvements
  • Various bug fixes

Note: extended docs and usage examples will be available later.

December 19, 2013

  • Added Bower support
  • Added to jQuery plugin registry

December 18, 2013

  • Added ARIA attributes support (for VoiceOver and others) @myfreeweb
  • Added Amazon Kindle support @skinofstars
  • Fixed clickable links inside labels @LeGaS
  • Fixed lines separation between labels and inputs
  • Merged two versions of the plugin (jQuery and Zepto) into one
  • Fixed demo links
  • Fixed callbacks @PepijnSenders

License

iCheck plugin is released under the MIT License. Feel free to use it in personal and commercial projects.

icheck's People

Contributors

ahawryla avatar damirfoy avatar lasseeee avatar olragon avatar richardkall avatar samvasko avatar sostenesgomes avatar szlegradi avatar valpackett 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icheck's Issues

Can't uncheck by label in iOS

Hi, thanks for the plugin. I'm running into an issue on iOS6 where tapping the label will not uncheck the checkbox. Is there a workaround?

Check on focus

Hi!

I'm trying to use the plugin, and I've noticed that the radio gets checked by simply focusing the input - $('input:first').focus(). Is there any reason for this to happen, or a recommended workaround?

Checkbox will default to jQuery Style

Hello.

Here is my code. No matter what I do, checkbox is defaulting to stand Jquery style i.e. with tags <div class="ui-checkbox">.... </div>

Can you please point me what I am doing wrong?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="jquery.mobile-1.3.0.min.css" rel="stylesheet"/>
<link href="jquery.mobile-1.3.0.min.css" rel="stylesheet"/>
<link href="jquery.mobile.structure-1.3.0.min.css" rel="stylesheet"/>
<link href="jquery.mobile.theme-1.3.0.min.css" rel="stylesheet"/>
<link href="skins/all.css" rel="stylesheet"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script type="text/javascript">
    $(document).ready(function() {
        $('input').iCheck() ;

        $('input').on('ifChecked', function(event){
            alert('hi');
        });
    });
</script>
<title>Untitled Document</title>
</head>

<body>
Hello World
<form>
<label for="abc">My Checkbox</label>
 <input type="checkbox" id="abc" data-theme="a"/>
</form>
<script type="text/javascript" src="../Frameworks/jquery-1.9.1/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../Frameworks/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.js"></script>
<script type="text/javascript" src="jquery.icheck.js"></script>
</body>
</html>

Issue #23 Part - Loses "checked" state

The issue #23 was resolved, but it caused another issue within. or partly fixed. When something is "checked" on the page load. and you have multiple forms (described in #23), if you move a radio button to another option, the other forms will remove their "checked" states

<form id="form1">
<input type="radio" name="test1" checked>
<input type="radio" name="test2">
</form>
<form id="form2 ">
<input type="radio" name="test1" checked>
<input type="radio" name="test2">
</form>

Example: if I change the radio option on form1 and go look at form2, the "checked" state is lost.

(thank you for fixes the previous issue so quickly)

Callbacks not working on dynamically added checkboxes

I have to dynamically add checkboxes to a form, so i create the checkbox element, append it to my form and then initialize iCheck on it. This effectively turns the checkbox in an iCheck-style checkbox, but the callbacks are not working.

// Dynamically add a checkbox
$('a.add-checkbox').on('click', function() {
    var input = '<input type="checkbox" id="mycheckbox" name="mycheckbox" />';
    $('form').append(input);

    $('#mycheckbox').iCheck({checkboxClass: 'icheckbox_flat-green',radioClass: 'iradio_flat-green'});
});

// This is not doing anything
$('#mycheckbox').on('ifChecked', function(event) {
    alert();
});

Note: The callbacks DO work on checkboxes that are already in the HTML on page load.

Installation

I want to thank you for so beautiful plugin. But it is difficult to set up.

Why have not you made ​​a small guide how to set up? I have spent 2 days with no luck.

Thanks in advance!

line skin (blue) does not initialize correctly

I implemented the setup steps for the blue Line Skin exactly. However, the checkmark and the X mark does not appear automatically on page load. But it starts to work after I go into Chrome Inspector and toggle on/off the element with the background containing those check and X marks... strange.

For my js code I only copied the code underneath Line skin "Usage". Whenever I try to use

$('.test input').iCheck({
  handle: 'checkbox'
});

as specified at the end of the documentation, my input fields simply disappear.

unchecked class

Hey. I was wondering if it's possible to add 'uncheckedClass' . So that when the plugin initializes it will either add the 'uncheckedClass' or 'checkedClass', depending on the state of the original input.

Also is it possible to have a separate 'checkedClass' and 'uncheckedClass' for radio buttons and checkboxes?

This also means that the callbacks need to be per input type.

Basically this is because I want to use font-awesome classes instead of images.

also, if you have a better solution to use font awesome instead of background images (sprite) then that would be greatly appreciated.

PSD Files

Excellent plugin! I've looked everywhere but couldn't find the PSD files. Would it be possible to make these public so we can add our own colors?

onclick events, related with the checkboxes, not work...

This is a great plugin I'm trying to implement on my little project (in local), but after some attempts (and after carefully read the relative docs) I would need a little help for a simple questions.
Following example is only for explaining purposes (really I've a hundred checkboxes on my form and all them are related to their "hidden div"), I've a simple "onclick" event on a checkbox (to shows/hides a div chained to it):
<input name="some_name" id="some_name" value="1" type="checkbox" onclick="if(this.checked) { jQuery('#hidden_div').slideToggle(800); } else { jQuery('#hidden_div').hide(400); }" />
When an user clicking the checkbox, the validation tool (for example) recognises the checkbox as "checked" but the onclick event doesn't fire.

To avoid to rebuilt all conditions in the "onclick" events it's possible to read dinamically all setted conditions to then fire them with a iCheck callback? (using for example: .attribute('onclick')?) or is a bad idea?.
I'm new on jQuery (I've started to study it only a few days ago) and any help will be really appreciate.

Is there support events mouseup mousedown?

Very often, the need to have multiple states checkbox:

  1. Checked
    2)Unchecked
    3)Disabled
    4)onmousedown
    5)onmouseup

on the demo page, i didn't see this effect(mousedown mouseup) something like default checkbox or radiobutton(without your plugin). You understand my quastion? Sorry for my bad english :(
checkbox
Look picture first line:

  1. we have 3 different states checkbox : normal , onmouseup , onmousedown.

Checked line checkbox does not have a hover state

Great work in general, really like it.
I noticed that you are using same css for line checkbox and radio. But therefore checkbox is missing hover state while unchecked. I think this can be solved just by adding iradio class and minor css change. Or creating whole new iradio_line, what do you think?

Issue

I am unable to get the value of selected checkbox or radio button and i haven't found any example as well related to this.

Thanks

Opera 9

When input is placed directly inside label and there's one more label inside that label, click on inner label doesn't work as expected.

The zepto plugin requires zepto.data

Call to $.data() without Zepto.data doesn't work with objects.

Thus the call:

      return input.data(_iCheck).o[state + (regular ? '' : 'Class')];

Will evaluate to

      return [object Object].o[state + (regular ? '' : 'Class')];

And property o of that string is obviously undefined, which triggers and error like Uncaught TypeError: Cannot read property 'uncheckedCheckboxClass' of undefined

Please update the doc to mention the need for the Zepto.data addon

Code is found at: https://github.com/fronteed/iCheck/blob/master/zepto.icheck.js#L389

Serialize Input[checkbox and radio] issue with jQuery

I've noticed jQuery $('xxx').serialize() can not read the input of checkbox/radio when I'm submitting through $.post() (which shouldn't make a difference).

I have tested running iCheck and disabling iCheck. serialize() is unable to read those variables. However, it works perfectly fine on other input types.

I've worked to try to figure out what is causing the issue. but it seems to be an issue when you do multiple forms on the same page with the same name inputs, thats what I've been able to reproduce.

<form id="form1"><input type="radio" name="test"></form>
<form id="form2"><input type="radio" name="test"></form>

(that is where it seems to have an issue sending the data to serialize.) I have removed iCheck and the setup worked perfectly. If you do one form, it worked fine.

Conflict with Bootstrap

Hello, been using bootstrap for quite a while now, so i decided to add iCheck. iCheck works perfect but breaks down Bootstrap. Botht the jQuery and the Zepto versions :: however i discovered that if you put the zepto version just before jQuery script it could work. Any idea?

Disabled

We should be able to toggle disabled state.

Installation?

Installation doesn't seem to be covered anywhere. From the sample docs it's not clear if I really need to include all 5 of your separate javascript files in the header.

What's the best way to quickly get flat style in another project i have without trying to change all my paths and such around (rails project)

It's a bit confusing…

Browser back button

From the tests I have done it looks like if you use the browser back button any selections made are not populated.

Something which is weird as well is that the radio buttons are not populated either, checking the style information on the page submit the buttons are not disabled or hidden so they should be going forward.

I have not been able to track down the issue anyone else come across this?

Revised note it may be an IE issue only?

problem with checkbox and radio inside label

when you put checkbox or radio inside label element (with for="id" or without) changing element status not working.

when I change your example like this:

<li> <label><input tabindex="1" type="checkbox" id="minimal-checkbox-1"> Checkbox 1</label> </li> <li> <label for="minimal-checkbox-2"><input tabindex="2" type="checkbox" id="minimal-checkbox-2"> Checkbox 2</label> </li>

nothing happens when click on checkbox or label.
I try it in IE, Firefox and Chrome.

Knockout Integration

hi,
beautiful beautiful plugin, thank you very much

is there a way to integrate with knockout, because knockout reacts only to normal input changes

thanks in advanced.

Performance (with large number of radios)

I have a table with about 400 rows, 4 radios in each row.
It takes about 30 seconds to convert them into icheck checkboxes....

While when I reduce a number to 60 rows with 4 radios in each - 1 second is all it takes.

So - something is disproportionately hogging performance there - I have no idea what exactly.... It does work faster in firefox though (10 seconds).... soo. not sure what to make of all tihs...

check uncheck

how to write something like

$('#loan_infin_check').on('ifClicked', function(event){

if($('#loan_infin_check').iCheck('check'))
{
  $("#variatie_onder1").val( $("#variatie_onder").val() );
  $("#variatie_onder").val('∞');
  $("#variatie_onder").focus();
$("#loan_infin_check").focus();
}
else
{
$("#variatie_onder").val("");
$("#variatie_onder").val($("#variatie_onder1").val());
$("#variatie_onder").focus();
$("#loan_infin_check").focus();
}
});

also how to uncheck element from other elements example

$("#variatie_onder").keyup(function(){
      if($("#variatie_onder").val() != '∞')
      {
         //$('#loan_infin_check').attr('checked', false);
         $('#loan_infin_check').iCheck('ifChecked');
      }
      else
      {
      $('#loan_infin_check').iCheck('check');
        // $('#loan_infin_check').attr('checked', true);
      }

   });

Implement "readonly" state

Now iCheck support the "disabled" state but not the "readonly" state ... and I haven't found a workaround.

This can be a feature request ? :)

ie7 jumpy radios

I've very complicated and long form on ie7 radios jumps everywhere

Links

Allow linking inside labels.

Click event

Hi,

I have to check in javascript my CHECKBOX...

So i start to do this $('#ID').click(); to perform this...

But it doesn't work...

I see in the plugin that :

if (type == 'click') {
                            return false;

so my event is never fired... and nothing changed...

Why the plugin don't work like this:

  • I click my ICHECK checkbox
  • this fire the click event of my checkbox
  • this click event of the checkbox fire the update of my icheck

Like this... if an onclick event is attached to my original checkbox, it will continue to work.

What do you think ?

thanks

Question: icon per radiobutton

Hi,
Beside having standaard checkboxes styled with iCheck
I have about 30 radio buttons that i want to assign different colours to them.

What is the best approach to do this?

skins source

hi

i tried to modify the png to fit my theme but no luck can you post the source of the png file ?

label

Hi,

On Chrome with a label we can't uncheck the chexbox.

WORK :

NOT WORK :

psd's ?

are psd's available please, i need the flat blue if its possible, thanks in advance

How to get this to work :)

Hi
Your script looks really great but I'm wondering how to get this to work.

I have jquery 1.7 running
I have jquery.icheck.js running.
I have added the start script inside my header.

$(document).ready(function(){
  $('input').iCheck({
    checkboxClass: 'icheckbox_minimal',
    radioClass: 'iradio_minimal',
    increaseArea: '20%' // optional
  });
});

I want to add my own styles so i just want the div to appear around the input and then hide the input.

But nothing happens. :/
Ok got it to start working with Drupal by changing the script to

jQuery(document).ready(function(){
  jQuery('input').iCheck({
    checkboxClass: 'icheckbox_minimal',
    radioClass: 'iradio_minimal',
    increaseArea: '20%' // optional
  });
});

Selectors

Parent selectors are buggy in some cases.

Remove or add disabled to input

Hi!

I have some inputs which are disabled by default. In somes cases, this disable state is remove (through jQuery in my case). After that, users can check the input, but disabledClass is maintained instead of being removed. Same thing on the other side (not disabled to disabled).

Hope I help you, and thank you for this great project 👍
Ornitier

How to use iCheck with Live

How can I apply iCheck to checkboxes/radios loaded from ajax?
In a normal HTML page works fine, but if I load this page from ajax, iCheck isn't applied.

I'm using this code :

$('input[type=checkbox], input[type=radio]').iCheck({
    checkboxClass: 'icheckbox_square-blue',
    radioClass: 'iradio_square-blue'
});

Cheers

Checkbox without label

Checkbox without label created with data-iconpos=notext shows two overlapping yet slightly visible checkboxes. The code looks like this
my label

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.