jQuery表斑马条纹与隐藏的行 [英] jQuery Table Zebra Striping with hidden rows

查看:80
本文介绍了jQuery表斑马条纹与隐藏的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用以下内容没有问题:

I have been using the following with no problems:

$("#tableid tr:even").addClass("evenClass");

但是现在我的表中有一些行被隐藏起来,这会破坏斑马条纹样式。我试过添加'is(:visible)'和类似的东西无济于事。有什么想法?

But now I have rows in my table that are hidden which messes up the zebra striping styles. I have tried add 'is(":visible")' and things like that to no avail. Any ideas?

推荐答案

尝试添加 :可见 伪选择器:

Try adding the :visible pseudo-selector:

$("#tableid tr:visible:even").addClass("evenClass");

演示: http://jsfiddle.net/gRyFx/1/

这篇关于jQuery表斑马条纹与隐藏的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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