jquery - Avoid "ifChanged" event handler when setting checkbox via Javascript -
For the ICheck plugin, is there a way to avoid setting fire to a "handset" event handler when setting up a checkbox from javascript? You can create a variable Change unchanged and subscribe to event handlers. However, you can check whether the variable is true and if so, set it to false and stop the function. If it is not correct , then you can execute your normal code. JS Code: Basically, whenever you set the variable Change unchanged to the correct, the next event call is ignored. It's quite a hack solution, though necessary, because i got no way to solve your problem iCheck library
var ignoreChange = false; $ ('Input'). ('If changed', function (event) {if (change unchanged) {ignorechange = false; return;} // do stuff}); // When the checkbox changes ignore = change;
Comments
Post a Comment