开发者

jQuery Table Zebra Striping with hidden rows

开发者 https://www.devze.com 2023-01-13 23:35 出处:网络
I have been using the following with no problems: 开发者_Python百科 $(\"#tableid tr:even\").addClass(\"evenClass\");

I have been using the following with no problems:

开发者_Python百科
$("#tableid tr:even").addClass("evenClass");

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");

Demo: http://jsfiddle.net/gRyFx/1/

0

精彩评论

暂无评论...
验证码 换一张
取 消