我的意思是,有什么方法可以知道某列是否被隐藏吗?我刚刚学会用
隐藏它们$('#tableG td:nth-child('+(index+1)+'), #tableG th:nth-child('+(index+1)+')').hide();
但现在我需要获取状态,是否有类似的内容:
if($('#tableG th:nth-child('+(index+1)+')').show() == true) { ... }
最佳答案
您想使用这种表示法:
$(element).is(":visible")
所以:
if($('#tableG th:nth-child('+(index+1)+')').is(":visible")) {...}
关于jquery - 如何使用 JQuery 获取列的状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9006783/