Why is this jQuery not crawling / showing hidden elements?

I am creating strings with ids foapalrow3 and foapalrow4 in C #, making them temporarily invisible:

foapalrow3 = new HtmlTableRow();
foapalrow3.ID = "foapalrow3";
. . .
foapalrow3.Visible = false;

foapalrow4 = new HtmlTableRow();
foapalrow4.ID = "foapalrow4";
. . .
foapalHTMLTable.Rows.Add(foapalrow4);
foapalrow4.Visible = false;

      

Then I have jQuery to make this visible again:

$(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();
    }
});

      

... but it doesn't work - the lines are still not showing. Is it that "visible == false" in C # does not match "display == none" in jQuery or what?

+3


source to share


1 answer


You can check the display property using



$('[id$=foapalrow4]').is(":visible"); 

      

+5


source







All Articles