drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.38k stars 1.62k forks source link

on click doesn't work #216

Closed lucky442 closed 9 years ago

lucky442 commented 10 years ago

i have created on click function in jquery if i click on list which is parent element it doesn't trigger the icheck to be checked

$("li").on("click",function(event) { var target = $(event.target); if (target.is('input:checkbox')) return;

          var checkbox = $(this).find("input[type='checkbox']");

          if( !checkbox.prop("checked") ){
              checkbox.prop("checked",true);
          } else {
              checkbox.prop("checked",false);
          }
      });
GiPeterMo commented 10 years ago

Hey, just stumbled upon this problem myself.

For me changing

on("click",function(event) to on("ifChecked",function(event)

fixed the problem.

wertgroup commented 10 years ago

Hi! Im using on("ifChecked",function(event) But not work on mobile browsers. Any idea? Thanks!

wertgroup commented 10 years ago

Sorry. Its works! :P