【发布时间】:2013-09-20 20:49:10
【问题描述】:
我正在制作一个应用程序,在单击某个 div 时使用jQuery.icheck 显示单选按钮,我想在检查其中一个按钮时采取某种操作,我正在使用 icheck 网站中列出的说明但没有得到我正在使用的代码:
var itemoptions=[],optionstring='', oi=0;
for(oi=0;oi<=oc-1;oi++) {
itemoptions[oi]=$('menu').find($(".selected").text()).children().eq(si).children().eq(oi).prop('nodeName');
optionstring=optionstring+'<input type="radio" name="iCheck"><p style="line-height:10px; font-size:15px;">'+(itemoptions[oi]).toString()+'</p>'
}
$('.item_block').on('click',function(){
$('input').iCheck('check'); // here's the line of code that is supposed to be used to check all of he icheck radio buttons
$(this).addClass('flipped_item');
$(this).flip({ //flipping options
direction:'lr',
speed:250,
content:"<div class='option_wrapper'>"+optionstring+"</div>",
onEnd:function(){$('input').iCheck({
checkboxClass: 'icheckbox_flat-yellow',
radioClass: 'iradio_flat-yellow'
});
})
【问题讨论】:
-
对这个问题有点困惑。您绑定一个事件还是要更改按钮的某些内容?究竟是什么问题,你有什么尝试。带有标记示例的小提琴 (jsfiddle.net) 也会有所帮助。
标签: javascript jquery html radio-button icheck