1.将下面的代码复制到 <body> 或者内
<script language="VBScript">
sub hello
document.fgColor=int(256*256*256*rnd)
end sub
</script>
2.在文本上加上 onMouseMove="hello()"
<p onMouseMove="hello()">鼠标经过时就会变色的文本</p>
<script language="VBScript">
sub hello
document.fgColor=int(256*256*256*rnd)
end sub
</script>
2.在文本上加上 onMouseMove="hello()"
<p onMouseMove="hello()">鼠标经过时就会变色的文本</p>
<div class="cl1" id="Layer1" style="position:absolute; left:96px; top:70px; width:466px; height:12px; z-index:1; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;" onmousemove="var pos=Math.floor(event.offsetX/6,1);if(pos<=25*6){this.innerHTML=this.innerText.substring(0,pos)+'<font color=\'#ff0000\'>'+this.innerText.substr(pos,1)+'</font>'+this.innerText.substr(pos+1);}">fsafdsfdsfdsafdsfdsafafdsa</div>
在head之间加入:
<style>
.cl1{font-size:12px}
</style>