JS控制按钮自动切换背景颜色,可暂停_脚本之家 .grigg{ position:relative; font-family:Verdana; font-size:16px;color:#ffffff; } y=" "; function colourWrite(){ y=document.bgColor; if (document.layers) {x=document.FM.box.value} if (document.all) {x=document.all.kurt.innerHTML} r=x+=y.toUpperCase(); Wrte=r+" "; if (document.layers) { document.FM.box.value=Wrte; document.layers.kurt.document.open(); document.layers.kurt.document.write("<div style='position:absolute;top:0px;left:0px;font-family:Verdana;font-size:16px;color:#ffffff;'>"+Wrte+""); document.layers.kurt.document.close(); } if (document.all) document.all.kurt.innerHTML= Wrte; } var amount=0; function counter(){ var colourElements="0123456789ABCDEF"; var Split=colourElements.split(''); for (i=0; i < Split.length; i++) var a=Math.round(Math.random()*[i]); var b=Math.round(Math.random()*[i]); var c=Math.round(Math.random()*[i]); var d=Math.round(Math.random()*[i]); var e=Math.round(Math.random()*[i]); var f=Math.round(Math.random()*[i]); var G=Split[a]; var H=Split[b]; var I=Split[c]; var J=Split[d]; var K=Split[e]; var L=Split[f]; //stop error! if ((G == null)||(H == null)||(I == null)||(J == null)||(K == null)||(L == null)) counter(); else { var RandomColour=G+H+I+J+K+L; document.bgColor=RandomColour; amount++; TMR=setTimeout('counter()',1500) } } //--> 脚本之家 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]