form.on('checkbox()', function(data){ {#console.log(data.elem); //得到checkbox原始DOM对象#} console.log(data.elem.checked); //是否被选中,true或者false var check=$(this);//选中的复选框 var trs = check.parent().parent().parent().parent(); $.each(trs,function(i,tr){ $.each($(tr).find('img'),function(j,imgg){ if(data.elem.checked){ $(imgg)[0].className='onchecked'; $(imgg).parent().parent().css("background","#87cefa"); }else{ $(imgg).parent().parent().css("background","#ffffff"); $(imgg)[0].className=''; } }) }) });
layui 复选框绑定行选中
最新推荐文章于 2024-05-17 15:59:45 发布