`

table 隔行换色

阅读更多

一直没注意table的隔行换色,突然要调试一个隔行换色,于是。

function table_even_odd(){
		$("#showcss table  tr:odd").css("background-color","#fbfbfb");
		$("#showcss table  tr:even").css("background-color","#ffffff");
	}
	function table_css_hover(){
		table_even_odd();
		var tabletrbg="";
		var tabletrbg="";
		$("#showcss table tr").hover(
			function(){
				tabletrbg=$(this).css("background-color");
				$(this).css("background-color","#f9f9f9");
			},
			function(){
				$(this).css("background-color",tabletrbg);
			}
		);
	}

 

小列子。分享下。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics