我想在更改事件时处理单选按钮。但是,由于设计人员已经使用了 iCheck-helper,因此在代码运行时不会执行实际的 radio 操作。
下面是代码
<div class="radio-wrap">
<input type="radio" id="bg-effect" value="full" />Full Image
</div>
当我们运行代码并在 chrome 中检查代码时,生成的 HTML 如下所示。
<div class="radio-wrap">
<div class="iradio_minimal-grey checked"><input type="radio" id="bg-effect" value="full" checked="" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);"></ins></div>Full Image
</div>
要捕获选定的值,我想处理此单选按钮的更改事件。
最佳答案
根据 documentation ,您可以像这样使用 ifChanged
事件:
$('#bg-effect').on('ifChanged', function(event){
alert(event.type + ' callback');
});
关于javascript - 使用iCheck-helper时如何处理radio事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25562062/