我有以下示例: LIVE EXAMPLE
我的语句返回 false,为什么?
if( $('.superstars-table tr').slice(5).is(':hidden') == true ){ alert('yes');}
最佳答案
因为您的选择器 $('.superstars-table tr').slice(5)
不匹配任何元素。 slice()
方法是零索引,因此请尝试使用$('.superstars-table tr').slice(4)
。
关于Jquery 返回 false - 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6910011/