Tue

03

Mar

2009

60、彩色渐变带

60、彩色渐变带

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript1.2">

<!--

 

if (document.all){

one=new Array();

two=new Array();

var a=10;var b=11;var c=12;var d=13;var e=14;var f=15;

 

 

//configure gradient

 

//width and height of gradient

var width = 250;

var height = 20;

 

//no of pixels between colours

var gap = 5;

 

//0 for horizontal, 1 for vertical

var direction = 0;

 

//colour number 1 - enter 1st, 3rd and 5th numbers/letters of colour code

one[0]=f;

one[1]=f;

one[2]=0;

 

//colour number 2 - enter 1st, 3rd and 5th numbers/letters of colour code

two[0]=0;

two[1]=c;

two[2]=0;

 

 

//end configuration

 

 

if(direction==0) var num = width / gap;

if(direction==1) var num = height / gap;

color2=new Array();

color1=new Array();

diff=new Array();

for(i=0;i<3;i++) {

diff[i] = two[i] - one[i];

diff[i] = diff[i] / num;

}

for(i=0;i<3;i++){

color1[i] = Math.round(diff[i] * Math.pow(10, 0));

if(color1[i] > diff[i])color1[i] = color1[i] - 1;

color2[i] = diff[i] - color1[i];

color2[i] = color2[i] * 15;

color2[i] = Math.round(color2[i] * Math.pow(10, 0));

}

x=new Array();

two[0]=0;

two[1]=0;

two[2]=0;

document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+width+'" height="'+height+'">');

if(direction==0) document.write('<tr>');

for(i=0;i<=num;i++) {

if(direction==1) document.write('<tr>');

document.write('<td bgcolor="#');

for(j=0;j<3;j++) {

if(one[j]==a)document.write("a");

if(one[j]==b)document.write("b");

if(one[j]==c)document.write("c");

if(one[j]==d)document.write("d");

if(one[j]==e)document.write("e");

if(one[j]==f)document.write("f");

if(one[j]<10)document.write(one[j]);

if(two[j]==a)document.write("a");

if(two[j]==b)document.write("b");

if(two[j]==c)document.write("c");

if(two[j]==d)document.write("d");

if(two[j]==e)document.write("e");

if(two[j]==f)document.write("f");

if(two[j]<10)document.write(two[j]);

one[j] = one[j] + color1[j];

two[j] = two[j] + color2[j];

if(two[j]>15) {

two[j] = two[j] - 15;

one[j]++;

}

}

if(direction==0) document.write('" width="'+gap+'" height="'+height+'">&nbsp;</td>');

if(direction==1) document.write('" width="'+width+'" height="'+gap+'">&nbsp;</td></tr>');

}

document.write('</table>');

}

//-->

</script>

0 Comments

Tue

03

Mar

2009

59、非常酷的颜色配色方案

59、非常酷的颜色配色方案

#003300

0 Comments

Tue

03

Mar

2009

58、背景图片的选择与演示

58、背景图片的选择与演示

脚本说明:

第一步:把如下代码加入<body>区域中

<input type=file size=25 name=uploadfile2 title="按游览选择图片,然后点背景图片"> <a href="javascript:bj()" title="按游览选择图片,然后点背景图片">背景图片</a> <a href="javascript:bl()" title="按此清除背景图片">清除</a>

<script language="JavaScript">

function selec(ssss){

ssss.select();document.execCommand("Copy")}

function bl(){all.background=""}

function bj(){if(uploadfile2.value==""){alert("请按左边的按钮选择一张图片作为背景");}

else{all.background=uploadfile2.value}}

</script>

 

第二步:把<body>中的代码改为:

<body   id=all>

 

0 Comments

Tue

03

Mar

2009

57、颜色选色程序

57、颜色选色程序

脚本说明:

把如下代码加入<body>区域中

<input id=kkk1 style=position:absolute;left:0;top:0>

<input id=kkk2 style=position:absolute;left:200;top:0>

<input id=kkk3 style=position:absolute;left:400;top:0>

<input id=kkk4 style=position:absolute;left:600;top:0>

<div id=RainBowDiv style='position:absolute;left:200;top:30;'></div>

<script>

var iW = '70';//共有6种颜色,每种颜色的宽为iWiW*6为色带的宽。

var iH = '400';//iH为色带的高。

//计算HSV颜色代码。

function HSV(){

kkk1.value = 'X:'+event.offsetX+'   Y:'+event.offsetY;

var H,S,V;

var pY = event.offsetY;

if(pY == 0){H = S = 0; V = 100;}

else{

 if(pY == iH-1) H = S = V = 0;

 else{

  H = Math.floor(360*event.offsetX/(iW*6));

  S = Math.round(50*(iH-pY)/(iH/2));

  V = Math.round(100-50*pY/iH);

  }

 }

kkk2.value='HSV('+H+','+S+'%,'+V+'%)';

HSVtoRGB(H,S/100,V/100);

}

 

//计算RGB颜色代码。

function HSVtoRGB(h,s,v){

var i, f ,p1 ,p2 ,p3;

var r = g = b = 0;

if(s < 0) s=0;

if(s > 1) s=1;

if(v < 0) v=0;

if(v > 1) v=1;

h %= 360;

if(h < 0) h+=360;

h /= 60;

i = Math.floor(h);

f = h-i;

p1 = v*(1-s);

p2 = v*(1-s*f);

p3 = v*(1-s*(1-f));

if(i == 0){r=v; g=p3; b=p1;}

else if(i == 1){r=p2; g=v; b=p1;}

else if(i == 2){r=p1; g=v; b=p3;}

else if(i == 3){r=p1; g=p2; b=v;}

else if(i == 4){r=p3; g=p1; b=v;}

else if(i == 5){r=v; g=p1; b=p2;}

kkk3.value='RGB('+Math.round(r*255)+','+Math.round(g*255)+','+Math.round(b*255)+')';

RGBtoHTML(Math.round(r*255),Math.round(g*255),Math.round(b*255))

}

 

//计算HTML颜色代码。

function RGBtoHTML(r,g,b){

r=(r>=16)?r.toString(16):('0'+r.toString(16))

g=(g>=16)?g.toString(16):('0'+g.toString(16))

b=(b>=16)?b.toString(16):('0'+b.toString(16))

kkk4.value='HTML #'+r+g+b;

}

/*

Dewin 写于 2002-08-17 10:37

*/

function window.onload(){

var RainBow = new Array(255,0,0,  255,255,0,  0,255,0,  0,255,255,  0,0,255,  255,0,255,  255,0,0);

for(var i=0;i<6;i++){

 var R1 = RainBow[i*3];

 var G1 = RainBow[i*3+1];

 var B1 = RainBow[i*3+2];

 var R2 = RainBow[(i+1)*3];

 var G2 = RainBow[(i+1)*3+1];

 var B2 = RainBow[(i+1)*3+2];

 RainBowDiv.innerHTML += "<div style='position:absolute;left:"+i*iW+";top:0;width:"+iW+";height:"+iH+";background:rgb("+R1+","+G1+","+B1+");'></div><div style='position:absolute;left:"+i*iW+";top:0;width:"+iW+";height:"+iH+";background:rgb("+R2+","+G2+","+B2+");filter:alpha(opacity=0,finishopacity=100,Style=1);'></div>"

 }

RainBowDiv.innerHTML += "<div style=position:absolute;left:0;top:0;width:"+6*iW+";height:"+iH+";background:rgb(128,128,128);filter:alpha(opacity=0,finishOpacity=100,style=1,starty=0,finishy=100,startx=0,finishx=0)></div><div style='position:absolute;left:0;top:0;width:"+(6*iW+1)+";height:"+iH+";' onmousemove=HSV()></div>"

}

</script>

0 Comments

Tue

03

Mar

2009

56、调色板工具

56、调色板工具

脚本说明:

把如下代码加入<body>区域中

<style type="text/css">

<!--

body {font:menu}

td,selcet,input {  font:menu}

.memo {  border: 1px #dddddd solid}

.button {  border-color: #CCCCCC #666666 #666666 #CCCCCC; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}

.cursorcross {  cursor: crosshair}

.cursorhand {  cursor: hand}

-->

</style>

<table border="0" cellspacing="1" cellpadding="3" width="350" align="center" bgcolor="#dddddd">

<tr bgcolor="#FFFFFF">

<td width="10%" align="center">

<select name="select1" onchange="selectchg(this.value)">

<option value="1" selected></option>

<option value="2">绿</option>

<option value="3"></option>

<option value="4"></option>

</select>

</td>

<td width="90%" align="center">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td align="right">

<input type="text" name="text1" class="memo" size="10">

<input type="button" name="Button2" value=">>" class="button" onClick="choosecolor()">

</td>

<td align="right" width="3%"> </td>

<td width="30%">

<table width="40" border="0" cellspacing="1" cellpadding="0" height="20"  class="cursorcross">

<tr>

<td id="customcolor" bgcolor="#FFFFFF"  onMouseOver="showcolor(this)"> </td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

<tr bgcolor="#FFFFFF">

<td width="10%" align="center">

<table id="tableleft" border="0" cellspacing="1" cellpadding="0" class="cursorhand">

<script language="VBScript">

function hexit(which)

hexit=hex(which)

end function

</script>

<script language="JavaScript">

for(i=0;i<=15;++i)

{document.write('<tr><td align="center">'+ hexit(0+i*17) +'</td><td id="tdleft' + i +'" bgcolor="rgb('+ (0+i*17) + ',0,0)" width="15" height="15" onclick="changeright(this.num)" onmouseover="showcolor(this)"></td></tr>')

 document.all['tdleft' + i].num=i

}

</script>

</table>

</td>

<td align="center" width="90%">

<table id="tableleft" border="0" cellspacing="1" cellpadding="0" class="cursorcross">

<script language="JavaScript">

document.write('<tr><td></td>')

for(i=0;i<=15;++i)

{document.write('<td align="center">'+ hexit(0+i*17) +'</td>')}

document.write('</tr>')

 

for(i=0;i<=15;++i)

{document.write('<tr>')

 document.write('<td align="center">'+ hexit(0+i*17) +'</td>')

 for(j=0;j<=15;++j)

  {document.write('<td id="tdrightr' + i + 'c' + j +'" bgcolor="rgb(0,'+ (0+i*17) + ',' + (0+j*17) + ')" width="15" height="15" onmouseover="showcolor(this)" onclick="clickright(this)"></td>')}

 document.write('</tr>')

}

 

</script>

</table>

</td>

</tr>

<tr bgcolor="#FFFFFF">

<td colspan="2" height="20">·可选16*16*16种颜色。<br>

·单击左边的颜色会得到更多的颜色。<br>

·单击右边的颜色会固定选取的颜色。 <br>

·输入框可以自定义颜色。</td>

</tr>

</table>

<script language="JavaScript">

function selectchg(which)

{switch(which)

  {case '1' :leftR();break;

   case '2' :leftG();break;

   case '3' :leftB();break;

   case '4' :leftA();break;

  }

}

function leftR()

{for(i=0;i<=15;++i)

   {document.all['tdleft'+i].bgColor='rgb('+ (0+i*17) + ',0,0)'}

 rightR(0)

}

function leftG()

{for(i=0;i<=15;++i)

   {document.all['tdleft'+i].bgColor='rgb(0,'+ (0+i*17) + ',0)'}

 rightG(0)

}

function leftB()

{for(i=0;i<=15;++i)

   {document.all['tdleft'+i].bgColor='rgb(0,0,'+ (0+i*17) + ')'}

 rightB(0)

}

function leftA()

{for(i=0;i<=15;++i)

   {document.all['tdleft'+i].bgColor='rgb('+ (0+i*17) + ','+ (0+i*17) + ','+ (0+i*17) + ')'}

 rightA()

}

function rightR(which)

{for(i=0;i<=15;++i)

   {for(j=0;j<=15;++j)

     {document.all['tdrightr' + i + 'c' + j].bgColor='rgb(' + (0+which*17) + ',' + (0+i*17) + ','+ (0+j*17) + ')'}

    }

}

function rightG(which)

{for(i=0;i<=15;++i)

   {for(j=0;j<=15;++j)

     {document.all['tdrightr' + i + 'c' + j].bgColor='rgb(' + (0+i*17) + ',' + (0+which*17) +  ',' + (0+j*17) + ')'}

    }

}

function rightB(which)

{for(i=0;i<=15;++i)

   {for(j=0;j<=15;++j)

     {document.all['tdrightr' + i + 'c' + j].bgColor='rgb(' + (0+i*17) + ','+ (0+j*17)+ ',' + (0+which*17) + ')'}

    }

}

function rightA()

{for(i=0;i<=15;++i)

   {for(j=0;j<=15;++j)

     {document.all['tdrightr' + i + 'c' + j].bgColor='rgb(' + (0+i*16+j) + ','+ (0+i*16+j)+ ',' + (0+i*16+j) + ')'}

    }

}

var rightclicked=false

function clickright(which)

{if(rightclicked){rightclicked=false;showcolor(which)}else{rightclicked=true}

}

function changeright(which)

{switch(select1.value)

  {case '1' :rightR(which);break;

   case '2' :rightG(which);break;

   case '3' :rightB(which);break;

 }

}

function showcolor(which)

{if(rightclicked)return;

 text1.value=which.bgColor

 choosecolor()

}

function choosecolor()

{customcolor.bgColor=text1.value

}

</script>

 

0 Comments

Tue

03

Mar

2009

55、拖动上下条实现颜色选择

55、拖动上下条实现颜色选择

<BODY bgcolor=#96CFB8 text=#000033>

184

207

000

150

0 Comments

Tue

03

Mar

2009

54、改变背景色

54、改变背景色

脚本说明:

把如下代码加入<body>区域中

<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="84" HEIGHT="100" BGCOLOR="#333333">

       <TR>

              <TD WIDTH="7" BGCOLOR="#660000"><A HREF="#" onmouseover="document.bgColor='#660000'"><FONT COLOR="#660000">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="maroon"><A HREF="#" onmouseover="document.bgColor='maroon'"><FONT COLOR="maroon">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#990000"><A HREF="#" onmouseover="document.bgColor='#990000'"><FONT COLOR="#990000">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CC0000"><A HREF="#" onmouseover="document.bgColor='#CC0000'"><FONT COLOR="#CC0000">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="red"><A HREF="#" onmouseover="document.bgColor='red'"><FONT COLOR="red">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF6666"><A HREF="#" onmouseover="document.bgColor='#FF6666'"><FONT COLOR="#FF6666">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF9999"><A HREF="#" onmouseover="document.bgColor='#FF9999'"><FONT COLOR="#FF9999">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FFCCCC"><A HREF="#" onmouseover="document.bgColor='#FFCCCC'"><FONT COLOR="#FFCCCC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#3366FF"><A HREF="#" onmouseover="document.bgColor='#3366FF'"><FONT COLOR="#3366FF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CC33FF"><A HREF="#" onmouseover="document.bgColor='#CC33FF'"><FONT COLOR="#CC33FF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="fuchsia"><A HREF="#" onmouseover="document.bgColor='fuchsia'"><FONT COLOR="fuchsia">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#999999"><A HREF="#" onmouseover="document.bgColor='#999999'"><FONT COLOR="#999999">x</FONT></A></TD>

       </TR>

       <TR>

              <TD WIDTH="7" BGCOLOR="#663300"><A HREF="#" onmouseover="document.bgColor='#663300'"><FONT COLOR="#663300">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#993300"><A HREF="#" onmouseover="document.bgColor='#993300'"><FONT COLOR="#993300">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CC6600"><A HREF="#" onmouseover="document.bgColor='#CC6600'"><FONT COLOR="#CC6600">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF6600"><A HREF="#" onmouseover="document.bgColor='#FF6600'"><FONT COLOR="#FF6600">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF6666"><A HREF="#" onmouseover="document.bgColor='#FF6666'"><FONT COLOR="#FF6666">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF9900"><A HREF="#" onmouseover="document.bgColor='#FF9900'"><FONT COLOR="#FF9900">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF9966"><A HREF="#" onmouseover="document.bgColor='#FF9966'"><FONT COLOR="#FF9966">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FFCC99"><A HREF="#" onmouseover="document.bgColor='#FFCC99'"><FONT COLOR="#FFCC99">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#0033CC"><A HREF="#" onmouseover="document.bgColor='#003399'"><FONT COLOR="#0033CC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CC00FF"><A HREF="#" onmouseover="document.bgColor='#CC00FF'"><FONT COLOR="#CC00FF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#FF00CC"><A HREF="#" onmouseover="document.bgColor='#FF00CC'"><FONT COLOR="#FF00CC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="gray"><A HREF="#" onmouseover="document.bgColor='gray'"><FONT COLOR="gray">x</FONT></A></TD>

       </TR>

       <TR>

              <TD WIDTH="7" BGCOLOR="#006600"><A HREF="#" onmouseover="document.bgColor='#006600'"><FONT COLOR="#006600">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="green"><A HREF="#" onmouseover="document.bgColor='green'"><FONT COLOR="green">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#009900"><A HREF="#" onmouseover="document.bgColor='#009900'"><FONT COLOR="#009900">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#00CC00"><A HREF="#" onmouseover="document.bgColor='#00CC00'"><FONT COLOR="#00CC00">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="lime"><A HREF="#" onmouseover="document.bgColor='lime'"><FONT COLOR="#66FF66">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#66FF66"><A HREF="#" onmouseover="document.bgColor='#66FF66'"><FONT COLOR="#66FF66">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#99FF99"><A HREF="#" onmouseover="document.bgColor='#99FF99'"><FONT COLOR="#99FF99">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CCFFCC"><A HREF="#" onmouseover="document.bgColor='#CCFFCC'"><FONT COLOR="#CCFFCC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#003399"><A HREF="#" onmouseover="document.bgColor='#003399'"><FONT COLOR="#003399">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#9900CC"><A HREF="#" onmouseover="document.bgColor='#9900CC'"><FONT COLOR="#9900CC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CC0099"><A HREF="#" onmouseover="document.bgColor='#CC0099'"><FONT COLOR="#CC0099">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#666666"><A HREF="#" onmouseover="document.bgColor='#666666'"><FONT COLOR="#666666">x</FONT></A></TD>

       </TR>

       <TR>

              <TD WIDTH="7" BGCOLOR="#003333"><A HREF="#" onmouseover="document.bgColor='#003333'"><FONT COLOR="#003333">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#006666"><A HREF="#" onmouseover="document.bgColor='#006666'"><FONT COLOR="#006666">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="teal"><A HREF="#" onmouseover="document.bgColor='teal'"><FONT COLOR="teal">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#009999"><A HREF="#" onmouseover="document.bgColor='#009999'"><FONT COLOR="#009999">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#00CCCC"><A HREF="#" onmouseover="document.bgColor='#00CCCC'"><FONT COLOR="#00CCCC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#66CCCC"><A HREF="#" onmouseover="document.bgColor='#66CCCC'"><FONT COLOR="#66CCCC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#66FFCC"><A HREF="#" onmouseover="document.bgColor='#66FFCC'"><FONT COLOR="#66FFCC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#99FFCC"><A HREF="#" onmouseover="document.bgColor='#99FFCC'"><FONT COLOR="#99FFCC">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="navy"><A HREF="#" onmouseover="document.bgColor='navy'"><FONT COLOR="navy">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#660099"><A HREF="#" onmouseover="document.bgColor='#660099'"><FONT COLOR="#660099">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#990066"><A HREF="#" onmouseover="document.bgColor='#990066'"><FONT COLOR="#990066">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#333333"><A HREF="#" onmouseover="document.bgColor='#333333'"><FONT COLOR="#333333">x</FONT></A></TD>

       </TR>

       <TR>

              <TD WIDTH="7" BGCOLOR="#000099"><A HREF="#" onmouseover="document.bgColor='#000099'"><FONT COLOR="#000099">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="blue"><A HREF="#" onmouseover="document.bgColor='blue'"><FONT COLOR="blue">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#0066FF"><A HREF="#" onmouseover="document.bgColor='#0066FF'"><FONT COLOR="#0066FF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#0099FF"><A HREF="#" onmouseover="document.bgColor='#0099FF'"><FONT COLOR="#0099FF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#00CCFF"><A HREF="#" onmouseover="document.bgColor='#00CCFF'"><FONT COLOR="#00CCFF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#66FFFF"><A HREF="#" onmouseover="document.bgColor='#66FFFF'"><FONT COLOR="#66FFFF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#99FFFF"><A HREF="#" onmouseover="document.bgColor='#66FFFF'"><FONT COLOR="#99FFFF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#CCFFFF"><A HREF="#" onmouseover="document.bgColor='#CCFFFF'"><FONT COLOR="#CCFFFF">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#000066"><A HREF="#" onmouseover="document.bgColor='#000066'"><FONT COLOR="#000066">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#330066"><A HREF="#" onmouseover="document.bgColor='#330066'"><FONT COLOR="#330066">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="#660033"><A HREF="#" onmouseover="document.bgColor='#660033'"><FONT COLOR="#660033">x</FONT></A></TD>

              <TD WIDTH="7" BGCOLOR="black"><A HREF="#" onmouseover="document.bgColor='black'"><FONT COLOR="black">x</FONT></A></TD>

       </TR>

</TABLE>

 

0 Comments

Tue

03

Mar

2009

53、打开网页的进度条

53、打开网页的进度条

要完成此效果把如下代码加入到<body>区域中

 

<form name=loading>

  <p align=center> <font color="#0066ff" size="2" face="Arial">载入中,请稍等...</font><br>

    <input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;">

    <br>

    <input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;">

    <script>

var bar=0

var line="||"

var amount="||"

count()

function count(){

bar=bar+2

amount =amount + line

document.loading.chart.value=amount

document.loading.percent.value=bar+"%"

if (bar<99)

{setTimeout("count()",100);}

else

{window.location = "http://7stk.com";}

}</script>

  </p>

</form>

 

0 Comments

Tue

03

Mar

2009

52、一个星空背景代码

52、一个星空背景代码

<style type="text/css">

#sDiv0, #sDiv1, #sDiv2, #sDiv3, #sDiv4, #sDiv5, #sDiv6, #sDiv7, #sDiv8, #sDiv9

{

position:absolute; height:1; width:1; font-family:arial black; font-size:9px; color:#FFFFAA; z-index:10;

}

</style>

<body bgcolor="#000000">

 

<SCRIPT LANGUAGE="JavaScript1.2">

var ns=(document.layers);

var ie=(document.all);

var w3=(document.getElementById && self.innerWidth && (window.pageXOffset>-1));

var allDivs      = new Array(10);

var documentWidth,documentHeight;

function initAll(){

        if(!ns && !ie && !w3)        return;

 

        for(dNum=0; dNum<10; ++dNum){

                if(ie)                allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');

                else if(ns)        allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');

                else if(w3)        allDivs[dNum]=eval('document.getElementById("sDiv'+dNum+'").style');

                moveTo(dNum,0,0);

        }

}

 

function moveTo(i,tempx,tempy){

        if (ie){

                documentWidth  =document.body.offsetWidth+document.body.scrollLeft-20;

                randomy=Math.floor(Math.random()*document.body.offsetHeight)+document.body.scrollTop-20;

        }

        else if (ns){

                documentWidth=window.innerWidth+window.pageXOffset-20;

                randomy=Math.floor(Math.random()*window.innerHeight)+window.pageYOffset-20;

        }

        else if (w3){

                documentWidth=self.innerWidth+window.pageXOffset-20;

                randomy=Math.floor(Math.random()*self.innerHeight)+window.pageYOffset-20;

        }

        if(tempx>-50){

                tempx-=45;

                allDivs[i].left=tempx;

                allDivs[i].top =tempy;

                setTimeout("moveTo("+i+","+tempx+","+tempy+")",40)

        }

        else

                setTimeout("moveTo("+i+",documentWidth-10,randomy)",2000/i+40);

}

 

window.onload=initAll

</script>

<div id="sDiv0">*</div>

<div id="sDiv1">*</div>

<div id="sDiv2">*</div>

<div id="sDiv3">*</div>

<div id="sDiv4">*</div>

<div id="sDiv5">*</div>

<div id="sDiv6">*</div>

<div id="sDiv7">*</div>

<div id="sDiv8">*</div>

<div id="sDiv9">*</div>

 

0 Comments

Tue

03

Mar

2009

51、颜色英文代码全集

51、颜色英文代码全集

</tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=honeydew width="50" class="lu">

        <div align="center"><font color="#000000">honeydew</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=golenrod width="50" class="lu">

        <div align="center"><font color="#FF0000">golenrod</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=forestgreen width="50" class="lu">

        <div align="center"><font color="#000000">forestgreen</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=gostwhite width="50" class="lu">

        <div align="center"><font color="#FFFF00">gostwhite</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=greenyellow width="50" class="lu">

        <div align="center"><font color="#FF0000">greenyellow</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=gainsboro width="50" class="lu">

        <div align="center"><font color="#000000">gainsboro</font></div>

      </td>

    </tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=firebrick width="50" class="lu">

        <div align="center"><font color="#FFFF00">firebrick</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=dodgerblue width="50" class="lu">

        <div align="center"><font color="#FFFF00">dodgerblue</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkturquoise width="50" class="lu">

        <div align="center"><font color="#000000">darkturquoise</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkslateblue width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkslateblue</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkslategray width="50" class="lu">

        <div align="center"><font color="#FFFFFF">darkslategray</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkseagreen width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkseagreen</font></div>

      </td>

    </tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=darkred width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkred</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkorchid width="50" class="lu">

        <div align="center"><font color="#000000">darkorchid</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkorenge width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkorenge</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkslateblue width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkslateblue</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkviolet width="50" class="lu">

        <div align="center"><font color="#000000">darkviolet</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=floralwhite width="50" class="lu">

        <div align="center"><font color="#FF0000">floralwhite</font></div>

      </td>

    </tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=cyan width="50" class="lu">

        <div align="center"><font color="#FF0000">cyan</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=bisque darkgray width="50" class="lu">

        <div align="center"><font color="#000000">bisque darkgray</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=cornsilk width="50" class="lu">

        <div align="center"><font color="#FF0000">cornsilk</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkolivegreen width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkolivegreen</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkgoldenrod width="50" class="lu">

        <div align="center"><font color="#000000">darkgoldenrod</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkblue width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkblue</font></div>

      </td>

    </tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=darkcyan width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkcyan</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkgreen width="50" class="lu">

        <div align="center"><font color="#000000">darkgreen</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkhaki width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkhaki</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=ivory width="50" class="lu">

        <div align="center"><font color="#FF0000">ivory</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkmagenta width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkmagenta</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkgray width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkgray</font></div>

      </td>

    </tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=cornfloewrblue width="50" class="lu">

        <div align="center"><font color="#FF0000">cornfloewrblue</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=cornfloewrblue width="50" class="lu">

        <div align="center"><font color="#000000">cornfloewrblue</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkviolet width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkviolet</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=floralwhite width="50" class="lu">

        <div align="center"><font color="#FF0000">floralwhite</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor width="50" class="lu">

        <div align="center"><font color="#FFcc00"> </font></div>

      </td>

      <td align=center cellspacing=6 bgcolor width="50" class="lu">

        <div align="center"><font color="#FFcc00"> </font></div>

      </td>

    </tr>

    <tr>

      <td align=center cellspacing=6 bgcolor=darkslategray width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkslategray</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkseagreen width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkseagreen</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkred width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkred</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkorchid width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkorchid</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkorenge width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkorenge</font></div>

      </td>

      <td align=center cellspacing=6 bgcolor=darkslateblue width="50" class="lu">

        <div align="center"><font color="#FFFF00">darkslateblue</font></div>

      </td>

    </tr>

  </table>

 

<br>

<SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

 

function goHist(a)

 

{

 

   history.go(a);

 

}

 

//-->

 

</script>

 

<FORM METHOD="post">

<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">

</form>

</center>

<br>

<br>

</body>

</html>

 

0 Comments

Tue

03

Mar

2009

50、拖动滚动条时滚动条及网页边框的颜色发生变化

50、拖动滚动条时滚动条及网页边框的颜色发生变化

1overflow内容溢出时的设置(设定被设定对象是否显示滚动条)
overflow-x
水平方向内容溢出时的设置
overflow-y
垂直方向内容溢出时的设置
以上三个属性设置的值为visible(默认值)scrollhiddenauto

2
scrollbar-3d-light-color立体滚动条亮边的颜色(设置滚动条的颜色)
scrollbar-arrow-color
上下按钮上三角箭头的颜色
scrollbar-base-color
滚动条的基本颜色
scrollbar-dark-shadow-color
立体滚动条强阴影的颜色
scrollbar-face-color
立体滚动条凸出部分的颜色
scrollbar-highlight-color
滚动条空白部分的颜色
scrollbar-shadow-color
立体滚动条阴影的颜色

我们通过几个实例来讲解上述的样式属性:
1.
让浏览器窗口永远都不出现滚动条
没有水平滚动条
<body style="overflow-x:hidden">
没有垂直滚动条
<body style="overflow-y:hidden">
没有滚动条
<body style="overflow-x:hidden;overflow-y:hidden">
<body
style="overflow:hidden">

2.
设定多行文本框的滚动条


没有水平滚动条
<textarea style="overflow-x:hidden"></textarea>

没有垂直滚动条
<textarea style="overflow-y:hidden"></textarea>

没有滚动条
<textarea style="overflow-x:hidden;overflow-y:hidden"></textarea>
<textarea style="overflow:hidden"></textarea>

3.
设定窗口滚动条的颜色

设置窗口滚动条的颜色为红色<body style="scrollbar-base-color:red">
scrollbar-base-color
设定的是基本色,一般情况下只需要设置这一个属性就可以达到改变滚动条颜色的目的。

加上一点特别的效果:
<body style="scrollbar-arrow-color:yellow;scrollbar-base-color:lightsalmon">

4.
在样式表文件中定义好一个类,调用样式表。
<style>
.coolscrollbar{scrollbar-arrow-color:yellow;scrollbar-base-color:lightsalmon;}
</style>
这样调用:
<textarea class="coolscrollbar"></textarea>

0 Comments

Tue

03

Mar

2009

49、漂亮的等待页面导航2

49、漂亮的等待页面导航2

要完成此效果把如下代码加入到<body>区域中

 

<script language="JavaScript">

<!-- Scroll Surprise by kurt.grigg@virgin.net

colours=new Array('ff0000','fff000','00ff00','ffa500','ff00ff','00ffff','ffffff')

function flash(){

var clrPos=Math.floor(Math.random()*colours.length)

 with (window.document.body.style){

 scrollbarTrackColor=document.bgColor;

 scrollbarFaceColor=document.bgColor;

 scrollbarArrowColor=colours[clrPos];

 scrollbar3dLightColor=colours[clrPos];   

 scrollbarHighlightColor=colours[clrPos];

 scrollbarShadowColor=colours[clrPos];

 scrollbarDarkShadowColor=colours[clrPos];

 borderWidth=2;

 borderStyle='solid';

 borderColor=colours[clrPos];

 }

}

if (document.all)window.document.body.onscroll=flash;

//-->

</script>

 

 

0 Comments

Tue

03

Mar

2009

48、漂亮的等待页面导航

48、漂亮的等待页面导航

本特效共分三步:

 

1.<head></head>中加入:

<SCRIPT type=text/javascript>

<!--

var ie5 = (document.all && document.getElementsByTagName);

var step = 0;

function setSB(v, el, inforEl, message) {

if (ie5 || document.readyState == "complete") {

filterEl = el.children[0];

valueEl = el.children[1];

 

if (filterEl.style.pixelWidth > 0) {

var filterBackup = filterEl.style.filter;

filterEl.style.filter = "";

filterEl.style.filter = filterBackup;

}

 

filterEl.style.width = v + "%";

valueEl.innerText = v + "%";

inforEl.innerText = message;

}

}

function setSBByStep(v, el, inforEl, message) {

if (ie5 || document.readyState == "complete") {

step = step + v;

filterEl = el.children[0];

valueEl = el.children[1];

 

if (filterEl.style.pixelWidth > 0) {

var filterBackup = filterEl.style.filter;

filterEl.style.filter = "";

filterEl.style.filter = filterBackup;

}

 

filterEl.style.width = step + "%";

valueEl.innerText = step + "%"

inforEl.innerText = message;

}

}

 

function fakeProgress(v, el) {

if (v >= 101)

location.href="http://www.7stk.com/fine/ch/c01.htm";

else {

setSB(v, el, infor, "欢迎光临圣诞祝福,页面载入中,请稍等!");

window.setTimeout("fakeProgress(" + (v + 1) + ", document.all['" + el.id + "'])", 150);

}

}

 

//-->

</SCRIPT>

 

2.<body>中加入:onload=fakeProgress(0,sb)

  <BODY onload=fakeProgress(0,sb)>

 

3.<body></body>中加入:

<DIV align=center>

<DIV id=sb

style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; BACKGROUND: #99ccff; BORDER-LEFT: medium none; WIDTH: 400px; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 14px; TEXT-ALIGN: left">

<DIV id=sbChild1

style="FILTER: Alpha(Opacity=0, FinishOpacity=80, Style=1, StartX=0, StartY=0, FinishX=100, FinishY=0); OVERFLOW: hidden; WIDTH: 100%; POSITION: absolute; HEIGHT: 12px">

<DIV style="BACKGROUND: #000000; WIDTH: 100%" ;height:12px; overflow:

hidden></DIV></DIV>

<DIV

style="FONT-SIZE: 10px; WIDTH: 400px; COLOR: white; FONT-FAMILY: arial; POSITION: absolute; HEIGHT: 14px; TEXT-ALIGN: center"></DIV></DIV>

<P></P>

<DIV id=infor

style="FONT-SIZE: 11px; WIDTH: 100%; COLOR: #999999; FONT-FAMILY: arial; POSITION: relative; HEIGHT: 14px; TEXT-ALIGN: center"></DIV></DIV>

 

0 Comments

Tue

03

Mar

2009

47、当鼠标点击链接时加音效

47、当鼠标点击链接时加音效

要完成此效果需要两个步骤

 

第一步:把如下代码加入到<head>区域中

 

<script language=javascript>

var mid=new Array()

mid[0]="images/1.wav"

mid[1]="images/2.wav"

mid[2]="images/3.wav"

mid[3]="images/4.wav"

mid[4]="images/5.wav"

mid[5]="images/1.wav"

mid[6]="images/2.wav"

mid[7]="images/3.wav"

function clicksound(i)

{

  document.all.sound.src=mid[i]

}

</script>

 

 

第二步:把如下代码加入到<body>

 

<bgsound id=sound src="" loop=1>

 

<center>

  <a href="#" onclick="clicksound(0)">Click</a><br>

  <a href="#" onclick="clicksound(1)">Click</a><br>

  <a href="#" onclick="clicksound(2)">Click</a><br>

  <a href="#" onclick="clicksound(3)">Click</a><br>

  <a href="#" onclick="clicksound(4)">Click</a><br>

  <a href="#" onclick="clicksound(5)">Click</a><br>

<a href="#" onclick="clicksound(6)">NO!</a><br>

  <a href="#" onclick="clicksound(7)">Win!</a>

 

 

0 Comments

Tue

03

Mar

2009

46、随时间日期变化的音乐

46、随时间日期变化的音乐

脚本说明:

把如下代码加入<head>区域中

<table border=5 bordercolor=blue borderlight=green>

<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>跟据日期能听到不同的音乐!</strong></font></td></tr><tr><td align=center><SCRIPT language="JavaScript">

<!--

page=new Date();

if (page.getDate() == 1)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 2)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 3)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 4)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 5)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 6)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 7)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 8)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 9)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 10)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 11)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 12)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 13)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 14)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 15)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 16)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 17)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 18)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 19)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 20)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 21)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 22)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 23)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 24)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 25)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 26)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 27)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 28)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 29)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 30)

document.write("<bgsound src=sto/song2.mid width=145 height=30 autostart=true loop=-1 volume=50>");

 

if (page.getDate() == 31)

document.write("<bgsound src=sto/song1.mid width=145 height=30 autostart=true loop=-1 volume=50>");

page=new Date();

var months = new Array(13);

months[1] = "1";

months[2] = "2";

months[3] = "3";

months[4] = "4";

months[5] = "5";

months[6] = "6";

months[7] = "7";

months[8] = "8";

months[9] = "9";

months[10] = "10";

months[11] = "11";

months[12] = "12";

 

var dateObj = new Date()

var lmonth = months[dateObj.getMonth() + 1]

var date = dateObj.getDate()

 

document.write("<br>" +"今天是:"+ lmonth + date+""+"播放007主题曲")

 

//-->

 

 

</SCRIPT></td></tr>

</table>

 

 

 

0 Comments

Tue

03

Mar

2009

45、随机播放背景音乐的脚本

45、随机播放背景音乐的脚本

脚本说明:

把如下代码加入<body>区域中

<SCRIPT language="JavaScript">

<!--

var sound1="sto/song1.mid"

var sound2="sto/song2.mid"

var sound3="sto/song1.mid"

var sound4="sto/song2.mid"

var sound5="sto/song1.mid"

var sound6="sto/song2.mid"

var sound7="sto/song1.mid"

var sound8="sto/song2.mid"

var sound9="sto/song1.mid"

var sound10="sto/song2.mid"

var x=Math.round(Math.random()*9)

if (x==0) x=sound1

else if (x==1) x=sound2

else if (x==2) x=sound3

else if (x==3) x=sound4

else if (x==4) x=sound5

else if (x==5) x=sound6

else if (x==6) x=sound7

else if (x==7) x=sound8

else if (x==8) x=sound9

else x=sound10

if (navigator.appName=="Microsoft Internet Explorer")

document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')

else

document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')

 

 

//-->

 

 

</SCRIPT>

 

 

0 Comments

Tue

03

Mar

2009

44、用按钮来调整网页背景色

44、用按钮来调整网页背景色

要完成此效果需要两个步骤

 

第一步:把如下代码加入到<head>区域中

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function color(frm, clr, val) {

v = eval("0x" + frm[clr].value) + val;

if (v < 0 || v > 255) v -= val;

v = v.toString(16).toUpperCase();

while (v.length < 2) v = "0" + v;

frm[clr].value = v; nc = "";

for(i = 1; i < 8; i += 3) nc += frm.elements[i].value;

document.bgColor = nc;

}

function setval(item) {

v = prompt("请输入颜色代码 " + item.name + " (00 - FF)", item.value);

if (v) {

v = eval("0x" + v);

if ((v & 255) == v) {

item.value=v.toString(16).toUpperCase();

while (item.value.length < 2) item.value = "0" + item.value;

color(document.f, item.name, 0);

      }

   }

}

//  End -->

</script>

 

 

第二步:把如下代码加入到<body>区域中

 

<center>

<form name=f>

<table border=1>

<tr>

<td colspan=3 align=center bgcolor="#ff0000">RED</td>

<td colspan=3 align=center bgcolor="#00ff00">GREEN</td>

<td colspan=3 align=center bgcolor="#000ff">BLUE</td>

</tr>

<tr>

<td><input type=button name=rm value="<" onclick = "color(this.form, 'Red' , -1);"></td>

<td><input type=button name=Red value="AF" onclick = "setval(this);"></td>

<td><input type=button name=rp value=">" onclick = "color(this.form, 'Red', 1);"></td>

<td><input type=button name=gm value="<" onclick = "color(this.form, 'Green', -1);"></td>

<td><input type=button name=Green value="BF" onclick = "setval(this);"></td>

<td><input type=button name=gp value=">" onclick = "color(this.form, 'Green', 1);"></td>

<td><input type=button name=bm value="<" onclick = "color(this.form, 'Blue', -1);"></td>

<td><input type=button name=Blue value="CF" onclick = "setval(this);"></td>

<td><input type=button name=bp value=">" onclick = "color(this.form, 'Blue', 1);"></td>

</tr>

</table>

</form>

</center>

 

 

0 Comments

Tue

03

Mar

2009

43、背景颜色随机产生

43、背景颜色随机产生

要完成此效果需要两个步骤

 

第一步:把如下代码加入到<head>区域中

 

<SCRIPT LANGUAGE="JavaScript">

<!--

color=new Array("0","3","6","9","C","F");

speed=250;

document.bgColor="FFFFFF";

bg=new Array("FFFFFF","FFFFFF","FFFFFF");

function begin() {

document.form.col1.value=" X "; document.form.col2.value=" X ";

document.form.col3.value=" X "; i=0; roll(speed);

}

function roll(speedB) //轮子滚动

{

if (document.form.col1.value==" X ") {

document.form.c1.value=document.form.b1.value;

document.form.b1.value=document.form.a1.value;

document.form.a1.value=

color[Math.round(Math.random()*10)%6]+

color[Math.round(Math.random()*10)%6];  //利用随机函数产生轮子上的颜色值

}

if (document.form.col2.value==" X ") {

document.form.c2.value=document.form.b2.value;

document.form.b2.value=document.form.a2.value;

document.form.a2.value=

color[Math.round(Math.random()*10)%6]+

color[Math.round(Math.random()*10)%6];

}

if (document.form.col3.value==" X ") {

document.form.c3.value=document.form.b3.value;

document.form.b3.value=document.form.a3.value;

document.form.a3.value=

color[Math.round(Math.random()*10)%6]+

color[Math.round(Math.random()*10)%6];

}

setTimeout("roll("+speedB+")",speedB);

}

function stop(col) //轮子停止滚动

{

if (col==1) {document.form.col1.value="   ";i++;}

if (col==2) {document.form.col2.value="   ";i++;}

if (col==3) {document.form.col3.value="   ";i++;}

if (i==3) {

bg[0]=document.form.a1.value+

document.form.a2.value+

document.form.a3.value;

bg[1]=document.form.b1.value+

document.form.b2.value+

document.form.b3.value;

bg[2]=document.form.c1.value+

document.form.c2.value+

document.form.c3.value;

speedB=500000;roll(speedB);

   }

}

function view(letter) //颜色预览

{

document.bgColor=bg[letter];

document.form.color.value="#"+bg[letter];

}

-->

</script>

 

 

第二步把如下代码加入到<body>区域中

 

<form name="form">

  <table cellpadding=2 border=1 align="center">

    <tr><td align=center>

<input type=text name="a1" size=3 onFocus="this.blur()" value=" ">

<input type=text name="a2" size=3 onFocus="this.blur()" value=" ">

<input type=text name="a3" size=3 onFocus="this.blur()" value=" ">

<input type=button onClick="view(0)" value="预览"><br>

<input type=text name="b1" size=3 onFocus="this.blur()" value=" ">

<input type=text name="b2" size=3 onFocus="this.blur()" value=" ">

<input type=text name="b3" size=3 onFocus="this.blur()" value=" ">

<input type=button onClick="view(1)" value="预览"><br>

<input type=text name="c1" size=3 onFocus="this.blur()" value=" ">

<input type=text name="c2" size=3 onFocus="this.blur()" value=" ">

<input type=text name="c3" size=3 onFocus="this.blur()" value=" ">

<input type=button onClick="view(2)" value="预览"><br>

<input type=button onClick="stop(1)" value=" X " name="col1">

<input type=button onClick="stop(2)" value=" X " name="col2">

<input type=button onClick="stop(3)" value=" X " name="col3">

    

         </td>

<td valign=middle align=center>

<input type=button onClick="begin()" value="启动!"><p>

<table bgcolor=FFFFFF border=1 cellspacing=0>

<tr><td align=center valign=middle>"X" 轮子停止转动...<p>

BG Color = <input type=text size=7 value="#FFFFFF" name=color>

</td></tr>

</table>

</td></tr>

</table>

</form>

 

 

<p><center>

<table class=30pt>

<tr><td>颜色的随机产生

</tr><tr><td>按下启动按钮,右边的三排轮子开始滚动

</tr><tr><td>按下三个X按钮颜色值定下来

</tr><tr><td>按下预览按钮可看颜色效果

</tr>

</table>

 

0 Comments

Tue

03

Mar

2009

42、任由你自己选择背景图

42、任由你自己选择背景图

要完成此效果把如下代码加入到<body>区域中

 

<script language="JavaScript1.2">

<!--

function tile(){

if (!document.all)

return

var source=event.srcElement

if (source.tagName=="IMG")

document.body.style.backgroundImage="url("+source.src+")"

}

 

function restore(){

document.body.style.backgroundImage=''

}

document.body.onclick=restore

-->

</script>

      </p>

      <p align="center"><span class="bgimages" onClick="tile();event.cancelBubble=true">

      <img src="images/a.jpg" height=96 width=96 border=2>

      <img src="images/01.gif" height=96 width=96 border=2><br>

      <img src="images/03.gif" height=96 width=96 border=2>

      <img src="images/02.gif" height=96 width=96 border=2></span></p>

 

0 Comments

Tue

03

Mar

2009

41、打开页面时背景色的渐变

41、打开页面时背景色的渐变

要完成此效果需要两个步骤

 

第一步:把如下代码加入到<head>区域中

 

<SCRIPT Language="JavaScript">

 

<!-- 屏幕变色程序 -->

 

function BgColor()

 

{

 

var x = 0, step = 1

 

while( x <= 0xffffff)

 

        {

 

document.bgColor = x

 

x += step

 

step <<= 8

 

if( step >= 0x1000000) step = 1

 

}

 

}

 

BgColor()

 

</Script>

 

 

第二步:把“onLoad="BgColor()"”加在<body>标记里

例如:<body onLoad="BgColor()">

 

 

0 Comments

Tue

03

Mar

2009

40、用按钮来实现背景色的闪烁

40、用按钮来实现背景色的闪烁

要完成此效果把如下代码加入到<body>区域中

 

<script language="JavaScript">

function blinkit()

{

    intrvl=0;

    for(nTimes=0;nTimes<3;nTimes++)

    {

        intrvl += 200;

        setTimeout("document.bgColor='#0000FF';",intrvl);

        intrvl += 200;

        setTimeout("document.bgColor='#336699';",intrvl);

  }

}

</script>

 <input type="button" value="Blink" onClick="blinkit()">

 

 

0 Comments

Tue

03

Mar

2009

39、按钮分别来控制背景颜色自动改变

39、按钮分别来控制背景颜色自动改变

要完成此效果把如下代码加入到<body>区域中

 

<script language="JavaScript">

var COLOR = 999999

var woot = 0

function stoploop()

{

    document.bgColor = '#336699';

    clearTimeout(loopID);

}

function loopBackground()

{

    if (COLOR > 0)

    {

        document.bgColor = '#' + COLOR

        COLOR -= 111111

        loopID = setTimeout("loopBackground()",1)

    }

    else

    {

        document.bgColor = '#336699'

        woot += 10

        COLOR = 999999

        COLOR -= woot

        loopID = setTimeout("loopBackground()",1)

  }

}

</script>

  <input type="button" value="Start" onClick="loopBackground()">

  <br>

  <input type="button" value="Stop" onClick="stoploop()">

 

 

0 Comments

Tue

03

Mar

2009

38、在你的网页中加入下雨的效果

38、在你的网页中加入下雨的效果

要完成此效果把如下代码加入到<body bgcolor="#000000">区域中

 

<script language="JavaScript">

<!--

var no = 50;

var speed = 1;

var ns4up = (document.layers) ? 1 : 0;

var ie4up = (document.all) ? 1 : 0;

var s, x, y, sn, cs;

var a, r, cx, cy;

var i, doc_width = 800, doc_height = 600;

if (ns4up) {

doc_width = self.innerWidth;

doc_height = self.innerHeight;

}

else

if (ie4up) {

doc_width = document.body.clientWidth;

doc_height = document.body.clientHeight;

}

x = new Array();

y = new Array();

r = new Array();

cx = new Array();

cy = new Array();

s = 8;

for (i = 0; i < no; ++ i) { 

initRain();

if (ns4up) {

if (i == 0) {

document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");

document.write("top=\"1\" visibility=\"show\"><font color=\"#999999\">");

document.write(",</font></layer>");

}

else {

document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");

document.write("top=\"1\" visibility=\"show\"><font color=\"#999999\">");

document.write(",</font></layer>");

   }

}

else

if (ie4up) {

if (i == 0) {

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");

document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");

document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"#999999\">");

document.write(",</font></div>");

}

else {

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");

document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");

document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"#999999\">");

document.write(",</font></div>");

      }

   }

}

function initRain() {

a = 6;

r[i] = 1;

sn = Math.sin(a);

cs = Math.cos(a);

cx[i] = Math.random() * doc_width + 1;

cy[i] = Math.random() * doc_height + 1;

x[i] = r[i] * sn + cx[i];

y[i] = cy[i];

}

function makeRain() {

r[i] = 1;

cx[i] = Math.random() * doc_width + 1;

cy[i] = 1;

x[i] = r[i] * sn + cx[i];

y[i] = r[i] * cs + cy[i];

}

function updateRain() {

r[i] += s;

x[i] = r[i] * sn + cx[i];

y[i] = r[i] * cs + cy[i];

}

function raindropNS() {

for (i = 0; i < no; ++ i) {

updateRain();

if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {

makeRain();

doc_width = self.innerWidth;

doc_height = self.innerHeight;

}

document.layers["dot"+i].top = y[i];

document.layers["dot"+i].left = x[i];

}

setTimeout("raindropNS()", speed);

}

function raindropIE() {

for (i = 0; i < no; ++ i) {

updateRain();

if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {

makeRain();

doc_width = document.body.clientWidth;

doc_height = document.body.clientHeight;

}

document.all["dot"+i].style.pixelTop = y[i];

document.all["dot"+i].style.pixelLeft = x[i];

}

setTimeout("raindropIE()", speed);

}

if (ns4up) {

raindropNS();

}

else

if (ie4up) {

raindropIE();

}

 

-->

</script>

 

0 Comments

Tue

03

Mar

2009

37、页面转向的进度条

37、页面转向的进度条

要完成此效果把如下代码加入到<body>区域中

 

<form name="loading">

   <div align="center">

    <p><font color="#0000ff"><input name="chart" size="37" style="background-color: black; color: #FF0000; font-family: Arial; font-weight: bolder; border-style: none; padding: 0px"><br><input name="percent" size="53" style="background-color: black; color: #FFFFFF; text-align: center; border-style: none; border-width: medium">

    </font>

      <SCRIPT> 

var bar = 0 

var line = "||" 

var amount ="||" 

count() 

function count(){ 

bar= bar+3 

amount =amount  +  line 

document.loading.chart.value=amount 

document.loading.percent.value=bar+"%" 

if (bar<99) 

{setTimeout("count()",100);} 

else 

{window.location = "http://7stk.com";}  //要链接的页面

} 

</SCRIPT>

 

0 Comments

Tue

03

Mar

2009

36、背景选颜色随之改变

36、背景选颜色随之改变

要完成此效果把如下代码加入到<body>区域中

 

<FORM METHOD="POST" NAME="bgcolor">

 

<font color="silver">click here</font><input type="radio" name="bgcolor"  ONCLICK="document.bgColor='silver'"><BR>

 

<font color="lightslategray">click here</font><input type="radio" name="bgcolor"  ONCLICK="document.bgColor='lightslategray'"><BR>

 

<font color="azure">click here</font><input type="radio" name="bgcolor"  ONCLICK="document.bgColor='azure'"><BR>

 

<font color="lightgreen">click here</font><input type="radio" name="bgcolor"  ONCLICK="document.bgColor='lightgreen'"><BR>

 

<font color="lightblue">click here</font><input type="radio" name="bgcolor"  ONCLICK="document.bgColor='lightblue'"><BR>

 

<font color="white">click here</font><input type="radio" name="bgcolor"  ONCLICK="document.bgColor='white'"><BR>

 

</form>

 

 

0 Comments

Tue

03

Mar

2009

35、鼠标点击即可改变颜色

35、鼠标点击即可改变颜色

要完成此效果把如下代码加入到<body>区域中

 

<FORM>

  <div align="center">

    <SELECT Size=22 name=clr onChange="document.bgColor=this.options[this.selectedIndex].value">

      <OPTION VALUE="blue">blue

      <OPTION VALUE="aquamarine">aquamarine

      <OPTION VALUE="chocolate">chocolate

      <OPTION VALUE="darkred">dark red

      <OPTION VALUE="gold">gold

      <OPTION VALUE="red">red

      <OPTION VALUE="yellow">yellow

      <OPTION VALUE="hotpink">hotpink

      <OPTION VALUE="lime">lime

      <OPTION VALUE="darkkhaki">dark khaki

      <OPTION VALUE="cadetblue ">cadet blue

      <OPTION VALUE="darkgoldenrod">dark goldenrod

      <OPTION VALUE="darkslateblue">dark slate blue

      <OPTION VALUE="deeppink">deep pink

      <OPTION VALUE="darksalmon">dark salmon

      <OPTION VALUE="salmon">salmon

      <OPTION VALUE="tan">tan

      <OPTION VALUE="wheat">wheat

      <OPTION VALUE="tomato">tomato

      <OPTION VALUE="springgreen">springgreen

      <OPTION VALUE="turquoise">turquoise

      <OPTION VALUE="FFFFFF" SELECTED> White

    </select>

  </div>

</form>

 

0 Comments

Tue

03

Mar

2009

34、自己输入颜色代码

34、自己输入颜色代码

要完成此效果需要三个步骤

 

第一步:把如下代码加入到<head>区域中

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

 

function test(form) {

 

if (form.text.value == "")

 

alert("请输入你喜欢的颜色代码!")

 

else {

 

document.bgColor=(""+form.text.value+"");

 

   }

 

}

 

// End -->

 

</SCRIPT>

 

 

第二步:把如下代码加入到<body>区域中

 

<FORM>

  <div align="center"><B><font face="楷体_GB2312" size="3" color="#FFFFFF">输入你喜欢的颜色代码

 

</font><BR>

    <input type="text" name="text">

    <input type="button" name="button" value="输入" onClick="test(this.form)">

    </b></div>

</FORM>

 

 

第三步:把“onLoad="clear();display()"”加在<body>标记里

例如:<body onLoad="clear();display()">

 

0 Comments

Tue

03

Mar

2009

33、闪电闪烁背景代码

33、闪电闪烁背景代码

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

--></style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body>

<br>

<br>

<center><font color=red face="隶书" size=6>手动调节背景色</font></center>

<br>

<center>

<table border=1 bordercolor=#000000 borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">

<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面为脚本显示区</strong></font></td></tr><tr><td align=center><script language="JavaScript">

<!-- Hiding

 

var red=0;

var green=0;

var blue=0;

var value=0;

var convert = new Array()

var hexbase= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");

 

for (x=0; x<16; x++){

for (y=0; y<16; y++){

convert[value]= hexbase[x] + hexbase[y];

value++;

}

}

 

function clear(){

document.color.bl.value= blue;

document.color.rd.value= red;

document.color.gr.value= green;

}

 

function display(){

redx = convert[red]

greenx = convert[green]

bluex = convert[blue]

var rgb = "#"+redx+greenx+bluex;

document.color.rgbdspl.value= rgb;

document.bgColor =rgb;

}

 

function upred(x){

if ((red+x)<=255)

red+=x

document.color.rd.value= red;

display()

}

 

function downred(x){

if ((red-x)>=0)

red-=x

document.color.rd.value= red;

display()

}

 

function upgreen(x){

if ((green+x)<=255)

green+=x

document.color.gr.value= green;

display()

}

 

function downgreen(x){

if ((green-x)>=0)

green-=x

document.color.gr.value= green;

display()

}

 

function upblue(x){

if ((blue+x)<=255)

blue+=x

document.color.bl.value= blue;

display()

}

 

function downblue(x){

if ((blue-x)>=0)

blue-=x

document.color.bl.value= blue;

display()

}

 

// done hiding -->

</script>

<form name="color">

                    <table>

                      <tr align="Center">

                        <td>

                          <input name="red" type="button" value=" +50 " onClick="upred(50)">

                        </td>

                        <td>

                          <input name="red2" type="button" value=" + 10 " onClick="upred(10)">

                        </td>

                        <td>

                          <input name="red2" type="button" value=" + 1" onClick="upred(1)">

                        </td>

                        <td width="50"><font color="#FF0000" size=+3><b><font color="#FA0000"></font></b></font></td>

                        <td>

                          <input name="red-" type="button" value=" - 1" onClick="downred(1)">

                        </td>

                        <td>

                          <input name="red-" type="button" value=" - 10 " onClick="downred(10)">

                        </td>

                        <td>

                          <input name="red-" type="button" value=" -50 " onClick="downred(50)">

                        </td>

                        <td>

                          <input type="text" name="rd" size=3>

                        </td>

                      </tr>

                      <tr align="Center">

                        <td>

                          <input name="green" type="button" value=" +50 " onClick="upgreen(50)">

                        </td>

                        <td>

                          <input name="green" type="button" value=" + 10 " onClick="upgreen(10)">

                        </td>

                        <td>

                          <input name="green" type="button" value=" + 1" onClick="upgreen(1)">

                        </td>

                        <td width="50"><font color="#00FF00" size=+3><b><font color="#00FA00">绿</font></b></font></td>

                        <td>

                          <input name="green-" type="button" value=" - 1" onClick="downgreen(1)">

                        </td>

                        <td>

                          <input name="green-" type="button" value=" - 10 " onClick="downgreen(10)">

                        </td>

                        <td>

                          <input name="green-" type="button" value=" -50 " onClick="downgreen(50)">

                        </td>

                        <td>

                          <input type="text" name="gr" size=3>

                        </td>

                      </tr>

                      <tr align="Center">

                        <td>

                          <input name="blue" type="button" value=" +50 " onClick="upblue(50)">

                        </td>

                        <td>

                          <input name="blue" type="button" value=" + 10 " onClick="upblue(10)">

                        </td>

                        <td>

                          <input name="blue" type="button" value=" + 1" onClick="upblue(1)">

                        </td>

                        <td width="50"><font color="#0000FF" size=+3><b><font color="#0000FA"></font></b></font></td>

                        <td>

                          <input name="blue-" type="button" value=" - 1" onClick="downblue(1)">

                        </td>

                        <td>

                          <input name="blue-" type="button" value=" - 10 " onClick="downblue(10)">

                        </td>

                        <td>

                          <input name="blue-" type="button" value=" -50 " onClick="downblue(50)">

                        </td>

                        <td>

                          <input type="text" name="bl" size=3>

                        </td>

                      </tr>

                      <tr align="Center">

                        <td> </td>

                        <td> </td>

                        <td> </td>

                        <td width="50">

                          <input type="text" name="rgbdspl" size=7>

                        </td>

                        <td> </td>

                        <td> </td>

                        <td> </td>

                        <td> </td>

                      </tr>

                    </table>

                  </form>

</td></tr></table></center>

<br>

<br>

<center>

 <SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

 

function goHist(a)

 

{

 

   history.go(a);

 

}

 

//-->

 

</script></center>

<br>

<br>

<br>

<br>

<br>

<br>

0 Comments

Tue

03

Mar

2009

32、一个下雨的背景代码

32、一个下雨的背景代码

<STYLE>.drop {

       FONT-SIZE: 40px; FILTER: flipV(), flipH(); WIDTH: 3px; COLOR: blue; POSITION: absolute

}

</STYLE>

 

<SCRIPT language=javascript>

 

//Rain/Snow effect- By Craig Blanchette Craiga.topcities.com

//Script featured on Dynamic Drive

//Visit http://www.dynamicdrive.com for this script and more

 

snow = false;    // false-rain;   true-snow

snowsym = " * "  //These are the symbols for each

rainsym = " ' "  //You can put images here.

howmany = 10     //How many drops/snowflakes?

 

/**************Do not need to change anything below***********/

if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}

else{sym = rainsym; speed=50; drops=howmany; angle=6}

movex = -speed/angle; movey = speed; count = 0;

 

function moverain(){

for(move = 0; move < drops; move++){

xx[move]+=movex;  yy[move]+=mv[move];

hmm = Math.round(Math.random()*1);

if(xx[move] < 0){xx[move] = maxx+10;}

if(yy[move] > maxy){yy[move] = 10;}

drop[move].left = xx[move]

drop[move].top = yy[move]+document.body.scrollTop;

}setTimeout('moverain()','1')}

 

</SCRIPT>

<BGSOUND src="" loop=infinite></HEAD>

<body bgcolor="#000000">

 

 

 

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width=700 border=0>

 

 

</CENTER></DIV>

<SCRIPT language=javascript>

 

if (document.all){

drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()

ly = "document.all[\'"; st = "\'].style"

for(make = 0; make < drops; make++){

document.write('<div id="drop'+make+'" class=drop>'+sym+'</div>');

drop[make] = eval(ly+'drop'+make+st);

maxx = document.body.clientWidth-40

maxy = document.body.clientHeight-40

xx[make] = Math.random()*maxx;

yy[make] = -100-Math.random()*maxy;

drop[make].left = xx[make]

drop[make].top = yy[make]

mv[make] = (Math.random()*5)+speed/4;

drop[make].fontSize = (Math.random()*10)+20;

if(snow){col = 'white'}else{col = 'silver'}

drop[make].color = col;

}

window.onload=moverain

}

</SCRIPT>

 

0 Comments

Tue

03

Mar

2009

31、一个多个颜色代码

31、一个多个颜色代码

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

 

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<SCRIPT language=javascript>

<!--

function makeArray(q){for(i=1;i<=q;i++){this[i]=0}}Colors=new makeArray(7);Colors[1]="00";Colors[2]="33";Colors[3]="66";Colors[4]="99";Colors[5]="CC";Colors[6]="FF";

-->

</SCRIPT>

</head>

<body>

<br>

<br>

<center><font color=red face="隶书" size=6>背景颜色安全测试</font></center>

<br>

<br><center>

<table border=1 bordercolor=#000000 borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">

<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下页为效果显示区!</strong></font></td></tr><tr><td align=center width=400 height=200><center><table cellspacing=0 cellpadding=0><SCRIPT language=javascript>

<!--

for(i=1;i<=6;i++){for(j=1;j<=6;j++){for(k=1;k<=6;k++){var thiscolor=Colors[i]+Colors[j]+Colors[k];document.writeln("<tr><td height = 20 bgcolor = \"#" + thiscolor + "\" align = right><a href = ");document.writeln("\'\' onMouseOver = \"document.bgColor=\'"+thiscolor+"\'\">"+thiscolor+"</a></td></tr>");}}}

 

-->

 

 

</SCRIPT></table></center></td></tr>

</table></center>

<br>

<br>

<center>

 <SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

 

function goHist(a)

 

{

 

   history.go(a);

 

}

 

//-->

 

</script></center>

<br>

<br>

0 Comments