欢迎来到福编程网,本站提供各种互联网专业知识!

srcElement表格样式

发布时间:2006-09-03 作者: 来源:转载
functionchangeto(highlightcolor){source=event.srcElementif(source.tagName=="TR"||source.tagName=="TABLE")returnwhile(source.tagName!="TD")source=source.parentElementif(source.style.backgroundColor!=highlightcolor&&source.id!="ignore

functionchangeto(highlightcolor){
source=event.srcElement
if(source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if(source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

functionchangeback(originalcolor){
if(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if(event.toElement!=source)
source.style.backgroundColor=originalcolor
}

相关推荐