如上!
一般是JAVASCRIPT写的代码
可以用VBSCRIPT写吗
用JAVASCRIPT怎么写?(这个问题是不是该到JAVASCRIPT提啊!)
<script language=javascript>
function document.onmouseover() { if(event.srcElement.tagName=="A") { setInterval("changeColor()",100); } } function changeColor() { event.srcElement.style.color = makeColor(); } ////////////此部分没有错误////////// function makeColor() { var rgbNum = new Array(3); var rgbStr = new Array(3); var i, num; for(i=0;i<=2;i++){ num = Math.random()*255; rgbNum[i] = Math.round(num); } for(i=0;i<=2;i++){ rgbStr[i] = hext(rgbNum[i]); }
var colorStr; colorStr = "#" +rgbStr[0]+ rgbStr[1] +rgbStr[2];
// window.alert(colorStr);
return(colorStr);
setInterval("makeColor()",100); }
function hext(num) { var str = new Array(16);
str[0] ="0"; str[1] ="1"; str[2] ="2"; str[3] ="3"; str[4] ="4"; str[5] ="5"; str[6] ="6"; str[7] ="7"; str[8] ="8"; str[9] ="9"; str[10]="a"; str[11]="b"; str[12]="c"; str[13]="d"; str[14]="e"; str[15]="f";
var indexFirst,indexLast,colorLast,colorFirst;
if(num<16){ indexLast = num; colorFirst = "0"; colorLast = str[indexLast]; } else{ indexLast = num%16 ; indexFirst = (num - indexLast)/16; colorLast = str[indexLast]; colorFirst = str[indexFirst]; }
colorStr = colorFirst + colorLast ;
return(colorStr);
}
////////////////////////////////// </script>
看看代码那里错了啊!!!