我在C#中创建了ID为foapalrow3和foapalrow4的行,使它们暂时不可见:
foapalrow3 = new HtmlTableRow();
foapalrow3.ID = "foapalrow3";
. . .
foapalrow3.Visible = false;
foapalrow4 = new HtmlTableRow();
foapalrow4.ID = "foapalrow4";
. . .
foapalHTMLTable.Rows.Add(foapalrow4);
foapalrow4.Visible = false;
然后我让jQuery再次让它再次可见:
$(document).on("click", '[id$=btnAddFoapalRow]', function (e) {
if ($('[id$=foapalrow3]').css('display') == 'none') {
$('[id$=foapalrow3]').slideDown();
} else if ($('[id$ = foapalrow4]').css('display') == 'none') {
$('[id$=foapalrow4]').slideDown();
}
});
...但它不起作用 - 行仍未显示。它是"可见==假"在C#中不匹配" display == none"在jQuery中,还是什么?
答案 0 :(得分:5)
您可以使用
检查显示属性$('[id$=foapalrow4]').is(":visible");