使用iCheck-helper时如何处理无线电事件? [英] How to handle radio event when iCheck-helper is used?
本文介绍了使用iCheck-helper时如何处理无线电事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想处理更改事件的单选按钮。但是,由于设计人员已经使用了iCheck-helper,因此在运行代码时不会执行实际的无线电操作。
I want to handle the radio button on change event. But, as the designer has already used iCheck-helper, the actual radio actions are not performed when the code is run.
以下是代码
<div class="radio-wrap">
<input type="radio" id="bg-effect" value="full" />Full Image
</div>
当我们运行代码并检查chrome中的代码时,生成的HTML如下所示。
When we run the code and inspect the code in chrome, the generated HTML is as below.
<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>
要捕获所选值,我想处理此单选按钮的更改事件。
To capture the selected value, I want to handle the change event for this radio button.
推荐答案
根据文档,您可以使用 ifChanged
这样的事件:
According to documentation, you can use ifChanged
event like this:
$('#bg-effect').on('ifChanged', function(event){
alert(event.type + ' callback');
});
这篇关于使用iCheck-helper时如何处理无线电事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文