jQuery 如何确定表格行是否可见?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7554378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 23:59:37  来源:igfitidea点击:

How to determine if a table row is visible or not?

jquery

提问by naveen gupta

I want to know how to identify table row is visible or not. I want to resolve by using jQuery

我想知道如何识别表格行是否可见。我想通过使用 jQuery 来解决

回答by James Allardice

You can use the :visiblepseudo-selector, and the ismethod, which returns a boolean value:

您可以使用:visible伪选择器和is返回布尔值的方法:

if($("#tableRowId").is(":visible")) {
    //It's visible
}

回答by Jayendra

Is visible should help you :-

可见应该可以帮助您:-

$('#table_row').is(':visible')

回答by Tushar Ahirrao

This should work:

这应该有效:

var none=$("table tr").css("display")

if(none=="none"){
// Row is invisible
} else{
// Row is visible
}