超酷的鼠标可以任意拖拽的网页中的层

王朝html/css/js·作者佚名  2008-05-31
宽屏版  字体: |||超大  

<!-- http://www.knowsky.com -->

<!-- bbs http://www.knowsky.com/bbs-->

<!--要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中-->

<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>

<!--第二步:把如下代码加入到<body>区域中-->

<table width="30%" border="1" align="center" onMouseover="changeto('33ff33')" onMouseout="changeback('black')"

>

<tr>

<td>

<div align="center">http://www.knowsky.com</div>

</td>

</tr>

<tr>

<td>

<div align="center">http://www.knowsky.com</div>

</td>

</tr>

<tr>

<td>

<div align="center">http://www.knowsky.com</div>

</td>

</tr>

<tr>

<td>

<div align="center">http://www.knowsky.com</div>

</td>

</tr>

<tr>

<td>

<div align="center">http://www.knowsky.com</div>

</td>

</tr>

</table>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有