js表格点击变色隔行变色

来源:https://www.sucaihuo.com/js/1773.html 2017-04-20 22:47浏览(730) 收藏

这是一款表格变色代码,鼠标经过时是黄色点后变成蓝色代码
js表格点击变色隔行变色
分类:表单代码 > 表单插件 难易:初级
查看演示 下载资源 下载积分: 20 积分
function grid(o,a,b,c,d){

	var t=document.getElementById(o).getElementsByTagName("tr");

	for(var i=0;i<t.length;i++){
		
		t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
		
		t[i].onclick=function(){
			if(this.x!="1"){
				this.x="1";
				this.style.backgroundColor=d;
			}else{
				this.x="0";
				this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
			}
		}
标签: 表格变色
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2