开发者

jquery setting css dynamically slows down page

I have a page with a very large data table. the page loads fast but then I want to apply a certain style to the cells that are empty to draw attention to them. so before I show the table I use

$("table td:empty").addClass("emptyCell");

but this is making the page take a while to l开发者_如何学Pythonoad (and also stalls the loading gif I use but that's another issue all together). Does anyone have a better idea to style the empty table cells? is there a css selector I'm not aware of? the client only needs the site to work in firefox but a cross browser solution is better.

Thanks


If you don't care about IE (versions 8 or less) you could use this CSS3 pseudo-class.

table td:empty {
    color: gray;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜