jquery选中表格的某行变色
2015-07-20 12:46
549 查看
<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'}); }
相关文章推荐
- JQuery 异步处理,ajax post get getJSON...
- jquery 自定义事件
- jquery-plugin-validate插件做验证
- jquery实现radio按纽全不选和checkbox全选的实例
- jquery checkbox选择框公用方法
- zTree -- jQuery 树插件 使用小结
- jquery学习记录一:jquery动态添加html元素后设置其绑定事件
- jQuery学习之prop和attr的区别
- jquery animate 的 left right top 动画失效
- Jquery ajax 学习笔记
- 详细介绍jQuery.outerWidth() 函数具体用法
- jquery实现鼠标滑过小图查看大图的方法
- jQuery知识点总结(第二天)
- jQuery全屏滚动插件fullPage.js
- jquery组件开发
- jquery
- 自定义jquery ui日历
- 怎么让jQuery支持swipe事件
- html+jquery翻页相册(原创)
- jQuery.prop() 使用详解