function randColor() dim re,i,ranNum for i=1 to 3 randomize ranNum=hex(int(255*rnd)+1) if(len(ranNum)=1) then ranNum="0" & ranNum re=re & ranNum next randColor = "#" & re end function
sub test '设置最多产生1000个色块。 if counter>1000 then exit sub dim strHTML ,color color=randColor() strHTML="<span style='background-color:" & color & ";' onclick='vbs:getColor me' title='" & color & "'></span>" document.body.insertAdjacentHTML "beforeEnd",strHTML counter =counter +1 end sub
sub getColor(obj) ipt.value=obj.title ipt.select choice.style.backgroundColor=obj.title window.clipboardData.setData "Text",ipt.value end sub
sub gogogo aaa=window.setInterval("test","100","VBScript") end sub
sub shutUp window.clearInterval aaa end sub </SCRIPT> </head>
.over{
background-color: blue;
color: red;
}
.out{
background-color: ;
color: ;
}
</style>
<TABLE >
<TR>
<TD onmouseover="over(this)" onmouseout="over(this)">1</TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function over(obj){
obj.className=(obj.className == "over" ? "out" : "over")
}
//-->
</SCRIPT>
<script language="javascript">
function ChangeMe( obj, bChange )
{
obj.style.backgroundColor = bChange ? "#ff00000" : "";
obj.style.color = bChange ? "#ff00000" : "";
}
</script>
<script language="javascript">
var oldBackgroundColor,oldForeColor;
function over(oTR){
oldBackgroundColor = oTR.style.backgroundColor;
oldForeColor = oTR.style.color;
oTR.style.backgroundColor='#FF0';
oTR.style.color='#F60'"
}
function out(oTR){
oTR.style.backgroundColor=oldBackgroundColor;
oTR.style.color=oldForeColor;
}
<TR>
<TD onmouseover="this.style.color='red';this.style.background='#3399FF';" onmouseout="this.style.color='black';this.style.background='white';">1111111111111111</TD>
<TD onmouseover="this.style.color='#33FF66';this.style.background='#FF9900';" onmouseout="this.style.color='black';this.style.background='white';">22222222222</TD>
</TR>
</TABLE>
good luck!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>笨狼颜色选择器</title>
<style>
body,body.*
{
font-size:12;
}
span,button,input
{
margin:2;
width:50;
border:1px solid black;
height:18;
}
A
{
color:blue;
}
</style>
<SCRIPT LANGUAGE="vbScript">
dim aaa,counter
window.resizeTo window.screen.availWidth,window.screen.availHeight
window.moveTo 0,0
function randColor()
dim re,i,ranNum
for i=1 to 3
randomize
ranNum=hex(int(255*rnd)+1)
if(len(ranNum)=1) then ranNum="0" & ranNum
re=re & ranNum
next
randColor = "#" & re
end function
sub test
'设置最多产生1000个色块。
if counter>1000 then exit sub
dim strHTML ,color
color=randColor()
strHTML="<span style='background-color:" & color & ";' onclick='vbs:getColor me' title='" & color & "'></span>"
document.body.insertAdjacentHTML "beforeEnd",strHTML
counter =counter +1
end sub
sub getColor(obj)
ipt.value=obj.title
ipt.select
choice.style.backgroundColor=obj.title
window.clipboardData.setData "Text",ipt.value
end sub
sub gogogo
aaa=window.setInterval("test","100","VBScript")
end sub
sub shutUp
window.clearInterval aaa
end sub
</SCRIPT>
</head>
<body>
<button onclick="vbs:gogogo">选美</button>
<button onclick="vbs:shutUp" >停止</button>
<button onclick="vbs:window.location.reload " >刷新</button>
<span id="choice"></span>
<input id="ipt">
<A href="http://superdullwolf.cnzone.net">超级大笨狼制作,呜呼!~~君子好色,取之有道:)...</A>
<hr/>
</body>
</html>