开发者社区> 问答> 正文

怎样用js实现鼠标滑过时整行变色

要在一览画面里实现当鼠标滑过时整行变色,想问问用Js怎么实现?

展开
收起
小旋风柴进 2016-03-19 09:56:31 1931 0
1 条回答
写回答
取消 提交回答
  • function overIt(){ var the_obj = event.srcElement; if(the_obj.tagName.toLowerCase() == "td"){ the_obj=the_obj.parentElement; the_obj.oBgc=the_obj.currentStyle.backgroundColor; the_obj.oFc=the_obj.currentStyle.color; the_obj.style.backgroundColor='#71BAF0'; the_obj.style.color=''; } } function outIt(){ var the_obj = event.srcElement; if(the_obj.tagName.toLowerCase() == "td"){ the_obj=the_obj.parentElement; the_obj.style.backgroundColor=the_obj.oBgc; the_obj.style.color=the_obj.oFc; the_obj.style.textDecoration=''; } }
    2019-07-17 19:07:23
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
JavaScript面向对象的程序设计 立即下载
Delivering Javascript to World 立即下载
编程语言如何演化-以JS的private为例 立即下载