这是为什么不jQuery的向下滑动/显示隐藏(向上滑动)元素呢? [英] Why is this jQuery not sliding down/showing hidden (slid up) elements?

查看:216
本文介绍了这是为什么不jQuery的向下滑动/显示隐藏(向上滑动)元素呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个在C#foapalrow3和foapalrow4的标识行,使他们暂时看不见的:

I create rows with IDs of 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;



然后我有jQuery来condtionally使这再次可见:

I then have jQuery to condtionally 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();
    }
});



...但它不工作 - 该行仍没有显示。难道是看得见的==假,在C#不匹配显示屏==无jQuery中,还是什么?

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

推荐答案

你可以使用

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

这篇关于这是为什么不jQuery的向下滑动/显示隐藏(向上滑动)元素呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆