2012-01-25 25 views
2

我的意思是,有没有什么办法知道列是否隐藏?我只是学会了隐藏他们如何获得使用JQuery的列的状态?

$('#tableG td:nth-child('+(index+1)+'), #tableG th:nth-child('+(index+1)+')').hide(); 

,但现在我需要得到的状态,有没有其它东西一样:

if($('#tableG th:nth-child('+(index+1)+')').show() == true) { ... } 

回答

4

你想用这种表示法:

$(element).is(":visible") 

so:

if($('#tableG th:nth-child('+(index+1)+')').is(":visible")) {...}