event.srcElement+表格應(yīng)用
更新時間:2006年08月29日 00:00:00 作者:
<script language="JavaScript1.2">
function changeto(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
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
<table onMouseOver="changeto('white')" onMouseOut="changeback('#999999')">
function changeto(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
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
<table onMouseOver="changeto('white')" onMouseOut="changeback('#999999')">
相關(guān)文章
JS簡單判斷字符在另一個字符串中出現(xiàn)次數(shù)的2種常用方法
這篇文章主要介紹了JS簡單判斷字符在另一個字符串中出現(xiàn)次數(shù)的2種常用方法,結(jié)合實例形式分析了js字符串分割計算與正則操作2種實現(xiàn)技巧,需要的朋友可以參考下2017-04-04JS實現(xiàn)圖片預(yù)加載之無序預(yù)加載功能代碼
這篇文章主要介紹了JS實現(xiàn)圖片預(yù)加載之無序預(yù)加載功能代碼,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-05-05JavaScript中Require調(diào)用js的實例分享
下面小編就為大家?guī)硪黄狫avaScript中Require調(diào)用js的實例分享。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-10-10