drgullin / icheck

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

jQuery onclick events for check/radio boxes not being passed #132

Closed ahmdsmir closed 10 years ago

ahmdsmir commented 10 years ago

So if you have a code like this:

    jQuery(document).ready(function(){
        jQuery("#CheckboxID").click(function () {
            if (jQuery("#CheckboxID:checked").val()!=null) {
                jQuery("#subaccountfields").slideDown();
            } else {
                jQuery("#subaccountfields").slideUp();
            }

        });
    });

The click event is not passed when using iCheck. Is there a workaround for that? I'm using iCheck with an existing CMS which has several of these functions and it's rather impossible to change each and every one of them. So I was hoping for an existing solution.

skyzer commented 10 years ago

I have same issue and because of that the project is overdue. Other friend recommended uniformjs which does not have same problem jQuery('body').on('click', '.calculator-1 .iradio_minimal-blue', function() { console.log("clicked iradiominimal"); alert("clicked iradio div"); });

drgullin commented 10 years ago

Please read this https://github.com/fronteed/iCheck#january-23-2014-v20-release-candidate

You won't get this issue in newer version.

skyzer commented 10 years ago

Thanks for quick info. Because I am using angularjs, luckily this helped me https://github.com/fronteed/iCheck/issues/62

drgullin commented 10 years ago

You're welcome.

Angular.js can also be used with the 2.x version, there're already few notes about the integration.

@skyzer 2.x version doesn't have these issues.