<tr ng-click="+"selectRow("+i+");"+" ng-mouseover="+"changecolor("+i+");"+" id="+i+"></tr>
				
	//变色 
	$scope.changecolor = function (id){
		//第一种写法 不建议
		if(id=="1"){
			document.getElementById("1").style.background='#FFFF99';					
			document.getElementById("2").style.background='';
			document.getElementById("3").style.background='';
		}else if(id=="2"){
			document.getElementById("1").style.background='';
			document.getElementById("2").style.background='#FFFF99';
			document.getElementById("3").style.background='';
		}else if(id=="3"){
			document.getElementById("1").style.background='';
			document.getElementById("2").style.background='';
			document.getElementById("3").style.background='#FFFF99';
		}
		//另外一种写法 灵活
		var selrow="#"+id;
		/*if(id=="1"){
			$("#1").parent().children().css({'background':''});
			$("#1").css({'background':'#FFFF99'});
		}*/	
		$(selrow).parent().children().css({'background':''});
		$(selrow).css({'background':'#FFFF99'});
	}



posted on 2017-06-09 21:26  lxjshuju  阅读(312)  评论(0编辑  收藏  举报