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:

  var ignoreChange = false; $ ('Input'). ('If changed', function (event) {if (change unchanged) {ignorechange = false; return;} // do stuff}); // When the checkbox changes ignore = change;   

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

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -