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

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -