这有效:
function rowColors(){
$("table#remotes th").css("background-color", "#202020");
$("table#remotes tr").css("background-color", "#484848");
$("table#remotes tr:visible:odd").css("background-color", "#333333");
}
如何使用可变表ID来实现此目的?这不起作用:
function rowColors(tblid){
$("table#"+tblid+" th").css("background-color", "#202020");
$("table#"+tblid+" tr").css("background-color", "#484848");
$("table#"+tblid+" tr:visible:odd").css("background-color", "#333333");
}
rowColors(remotes);
也许因为remotes
是变量而不是字符串
rowColors('remotes');
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句