小代码

来源:互联网 发布:国际能源小数据 编辑:程序博客网 时间:2024/03/29 05:30

电脑运算能力:

<SCRIPT LANGUAGE="JavaScript">
<!--

document.write("<input type=button value=开始测试 onclick=check()>");

function timer() {
 return new Date().getTime();
 }


function check() {
ts=timer();
for(i=0;i<500000;i++)
temp=1+1;
te=timer();
document.write("执行50万次加法运算时间为:"+(te-ts)+"毫秒<p>");


ts=timer();
for(i=0;i<200000;i++)
temp=Math.sqrt(2);
te=timer();
document.write("执行20万次浮点运算时间为:"+(te-ts)+"毫秒");

}

//-->

随鼠标移动改变表格颜色:

onmouseover=this.style.backgroundColor='#66FF99' onmouseout=this.style.backgroundColor='#FFFFFF'

OR

tr {
star : expression(
 onmouseover=function() { this.style.backgroundColor="#66FF99"},
 onmouseout=function(){this.style.backgroundColor="#FFFFFF" }
 ) }

原创粉丝点击