我有一个复选框的onChange事件,该复选框触发一个切换某些TR的可见性的函数。我的问题是这个代码只适用于Firefox。我希望它为ie8工作。ASP.NET jquery检查检查不起作用
function toggleVisibility() {
if ($("#ctl00_PageContent_chkVisibility").is(':checked')) {
$('#ctl00_PageContent_freight_rate_column_chaair tr').each(function(i, val) { // Loop through rows in grid
if (i > 9 & i < 28) {
$('#ctl00_PageContent_freight_rate_column_chaair_r' + i).hide();
};
});
}
else {
$('#ctl00_PageContent_freight_rate_column_chaair tr').each(function(i, val) { // Loop through rows in grid
if (i > 9 & i < 28) {
$('#ctl00_PageContent_freight_rate_column_chaair_r' + i).show();
};
});
};
};
有没有人知道这样做的更好方法?
感谢
嘿感谢帮我。在我的if条件中,我使用了我的原始jquery选择器,因为它隐藏了我的用户控件,而不是根据ID隐藏正确的行。谢谢。 – 2012-07-20 14:05:43
没问题,我很高兴能帮上忙! – ORION 2012-07-20 14:09:28