event.srcElement+表格應(yīng)用
更新時(shí)間: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的各種排序算法實(shí)現(xiàn)(總結(jié))
下面小編就為大家?guī)?lái)一篇js的各種排序算法實(shí)現(xiàn)(總結(jié))。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-07-07JS簡(jiǎn)單判斷字符在另一個(gè)字符串中出現(xiàn)次數(shù)的2種常用方法
這篇文章主要介紹了JS簡(jiǎn)單判斷字符在另一個(gè)字符串中出現(xiàn)次數(shù)的2種常用方法,結(jié)合實(shí)例形式分析了js字符串分割計(jì)算與正則操作2種實(shí)現(xiàn)技巧,需要的朋友可以參考下2017-04-04微信小程序?qū)崿F(xiàn)保存影集和圖片到相冊(cè)
這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)保存影集和圖片到相冊(cè),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-08-08JS實(shí)現(xiàn)圖片預(yù)加載之無(wú)序預(yù)加載功能代碼
這篇文章主要介紹了JS實(shí)現(xiàn)圖片預(yù)加載之無(wú)序預(yù)加載功能代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-05-05JavaScript中Require調(diào)用js的實(shí)例分享
下面小編就為大家?guī)?lái)一篇JavaScript中Require調(diào)用js的實(shí)例分享。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-10-10跟我學(xué)習(xí)javascript的隱式強(qiáng)制轉(zhuǎn)換
跟我學(xué)習(xí)javascript的隱式強(qiáng)制轉(zhuǎn)換,感興趣的小伙伴們可以學(xué)習(xí)一下2015-11-11