Tue

17

Mar

2009

90、鼠标选中什么弹出选中内容

90、鼠标选中什么弹出选中内容

脚本说明:

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

<script>

bBool=false

var copiedtext=""

var tempstore=""

 

function initiatecopy() {

bBool=true;

}

 

function copyit() {

if (bBool) {

tempstore=copiedtext

document.execCommand("Copy")

copiedtext=window.clipboardData.getData("Text");

if (tempstore!=copiedtext) {

alert(copiedtext);

}

bBool=false;

}

}

 

document.onselectionchange = initiatecopy

document.onmouseup = copyit

 

</script>

 

0 Comments

Tue

17

Mar

2009

89、用鼠标移动页面

89、用鼠标移动页面

脚本说明:

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

<SCRIPT>

var old_y=0;  //记录鼠标按下时的Y轴位置

var yn=0;  //用于记录鼠标状态

function moveit()

{

if(yn==1 &&  event.button==1)  //如果鼠标左键按下就移动页面

document.body.scrollTop=(old_y-event.clientY); //移动页面

}

function downit()

{old_y=event.clientY+document.body.scrollTop; //记住鼠标按下时的Y轴位置

yn=1; //用于记住鼠标已按下

}

 

function upit()

{yn=0;}  //记住鼠标已放开

 

document.onmouseup=upit; //鼠标放开时执行upit()函数

document.onmousedown=downit; //鼠标按下时执行downit()函数

document.onmousemove =moveit; //鼠标移动时执行moveit()函数

</SCRIPT>

 

0 Comments

Tue

17

Mar

2009

88、泡沫页面效果

88脚本说明:

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

<script language="JavaScript">

<!--

P=new Image();

P.src="sto/xx.gif"; //Pre-load your image here!

Pic="sto/xx.gif";   //Type your image name here!

amount=20;        //Amount of images, not less than 2!

BY=-20;           //Your image height!

BX=-20;           //Your image width!

S=5;              //speed!

 

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

if (ns){

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

document.write("<LAYER NAME='netscape"+i+"' LEFT=0 TOP=0><img src="+Pic+"></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='explorer' src='"+Pic+"' style='position:absolute;top:0px;left:0px'>")}

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

}

R=new Array(),PB=new Array(),RD=new Array(),Y=new Array(),X=new Array(),D=new Array(),VB=0,HB=0,SP=new Array();;

for (i=0; i < amount; i++){Y[i]=10;X[i]=10;D[i]=Math.floor(Math.random()*80+10);SP[i]=Math.floor(Math.random()*S+3)}

function Curve(){

plusMinus=new Array(1,-1,2,-2,3,-3,0,1,-1)

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

R[i]=Math.floor(Math.random()*plusMinus.length);

RD[i]=plusMinus[R[i]];

}

setTimeout('Curve()',1800);

}

function MoveRandom(){

T=setTimeout('MoveRandom()',10);

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

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

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

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

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

PB[i]=D[i]+=RD[i];

y = SP[i]*Math.sin(PB[i]*Math.PI/180);

x = SP[i]*Math.cos(PB[i]*Math.PI/180);

if (D[i] < 0) D[i]+=360;

Y[i]+=y;

X[i]+=x;

VB=180-D[i];

HB=0-D[i];

//Corner rebounds! not necessary but looks nice.

if ((Y[i] < 1) && (X[i] < 1)) {Y[i]=1;X[i]=1;D[i]=45;}

if ((Y[i] < 1) && (X[i] > W+BX)) {Y[i]=1;X[i]=W+BX;D[i]=135;}

if ((Y[i] > H+BY) && (X[i] < 1)) {Y[i]=H+BY;X[i]=1;D[i]=315;}

if ((Y[i] > H+BY) && (X[i] > W+BX)) {Y[i]=H+BY;X[i]=W+BX;D[i]=225;}

//Edge rebounds!

if (Y[i] < 1) {Y[i]=1;D[i]=HB;} 

if (Y[i] > H+BY) {Y[i]=H+BY;D[i]=HB;} 

if (X[i] < 1) {X[i]=1;D[i]=VB;}

if (X[i] > W+BX) {X[i]=W+BX;D[i]=VB;}

var layer=(document.layers)?document.layers['netscape'+i]:explorer[i].style;

layer.top=Y[i]+YS;

layer.left=X[i]+XS;

}

}

function sTaRt(){Curve();MoveRandom()}

if (document.all||document.layers){sTaRt()}

//-->

</script>泡沫页面效果

 

0 Comments

Tue

17

Mar

2009

87、攻击鼠标的文字

87、攻击鼠标的文字

脚本说明:

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

<script language="JavaScript">

<!--

/****** Things you can change *****/

msg="网页制作特效欢迎你的光临";

msgSize=4;//1-7

FoNt='Arial';

CoLoR='777777';

speed=2;

 

/****** Things you shouldn't change *****/

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

msg=msg.split(''),amount=msg.length,Y=0,X=0,ypos=0,xpos=0,ybase=new Array(),xbase=new Array();

angle = new Array(),divTop= new Array(),divLeft=new Array();

DocHeight=(document.layers)?window.innerHeight:window.document.body.offsetHeight;

DocWidth=(document.layers)?window.innerWidth:window.document.body.offsetWidth;

 

//initial layer placement!

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

divTop[i]=Math.round(Math.random()*DocHeight);

divLeft[i]=Math.round(Math.random()*DocWidth);

}

if (ns){

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

{document.write('<layer name=nsd'+i+' top=0 left=0 width='+msgSize+' height='+msgSize+'><font face='+FoNt+' size='+msgSize+' color='+CoLoR+'>'+msg[i]+'</font></layer>');}

window.captureEvents(Event.MOUSEMOVE);

function nsMouse(evnt){

ypos = evnt.pageY-20;

xpos = evnt.pageX-10;

}

window.onMouseMove = nsMouse;

}

else{

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

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

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

{document.write('<div id=ied style="position:absolute;top:0px;left:0px;width:'+msgSize+';height:'+msgSize+'"><font face='+FoNt+' size='+msgSize+' color='+CoLoR+'>'+msg[i]+'</font></div>')}

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

function ieMouse(){

ypos = event.y-20;

xpos = event.x-10;

}

document.onmousemove = ieMouse;

}

 

 

 

 

function GoToMouse(){

var DocHeight=(document.layers)?window.innerHeight:window.document.body.offsetHeight;

var DocWidth=(document.layers)?window.innerWidth:window.document.body.offsetWidth;

var iscrll=(document.all)?document.body.scrollTop:0;

var nscrll=(document.layers)?window.pageYOffset:0;

if (!ns)hldr.style.top=iscrll;

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

Y = ypos - divTop[i];

X = xpos - divLeft[i];

angle[i] = Math.round(Math.atan2(Y,X) * 180/Math.PI);

if (angle[i] < 0) angle[i] += 360;

ybase[i]=Math.round(Math.random()*DocHeight);

xbase[i]=Math.round(Math.random()*DocWidth);

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

extra=Math.round(Math.random() * 200)

if (rep == 3)xbase[i] =-extra;

if (rep == 2)xbase[i] =DocWidth+extra;

if (rep == 1)ybase[i] =-extra;

if (rep == 0)ybase[i] =DocHeight;

y = Math.round(speed*Math.sin(angle[i]*Math.PI/180));

x = Math.round(speed*Math.cos(angle[i]*Math.PI/180));

divTop[i]+=y;

divLeft[i]+=x;                                                                   

if ((divLeft[i] > xpos-speed) && (divLeft[i] < xpos+speed/1.5) && (divTop[i] >= ypos-speed/1.5) && (divTop[i] <= ypos+speed/1.5))

{divTop[i]=ybase[i]+nscrll;divLeft[i]=xbase[i]}

var layer=(document.layers)?document.layers['nsd'+i]:ied[i].style;

layer.top=divTop[i];layer.left=divLeft[i];

}

S=setTimeout('GoToMouse()',10);

}

window.onload=GoToMouse;

//-->

</script>

 

0 Comments

Tue

17

Mar

2009

86、三色鼠标效果

86、三色鼠标效果

脚本说明:

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

<script language="JavaScript">

<!--

 

//Choose colours and size of effect !!

var a_Colour='ff0000';

var b_Colour='ffffff';

var c_Colour='0000ff';

var Size=50;

//Alter nothing below !!

 

var YDummy=new Array(),XDummy=new Array(),xpos=0,ypos=0,ThisStep=0;step=0.2;

if (document.layers){

window.captureEvents(Event.MOUSEMOVE);

function nsMouse(evnt){

xpos = window.pageYOffset+evnt.pageX+6;

ypos = window.pageYOffset+evnt.pageY+16;

}

window.onMouseMove = nsMouse;

}

else if (document.all)

{

function ieMouse(){

xpos = document.body.scrollLeft+event.x+6;

ypos = document.body.scrollTop+event.y+16;

}

document.onmousemove = ieMouse;

}

 

function swirl(){

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

 {

  YDummy[i]=ypos+Size*Math.cos(ThisStep+i*2)*Math.sin((ThisStep+i*25)/2);

  XDummy[i]=xpos+Size*Math.sin(ThisStep+i*2)*Math.sin((ThisStep+i*25)/2)*Math.sin(ThisStep/4);

 }

ThisStep+=step;

setTimeout('swirl()',10);

}

 

var amount=10;

if (document.layers){

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

{

document.write('<layer name=nsa'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+a_Colour+'></layer>');

document.write('<layer name=nsb'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+b_Colour+'></layer>');

document.write('<layer name=nsc'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+c_Colour+'></layer>');

}

}

else if (document.all){

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

+'<div id="IDiv" style="position:relative">');

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

{

document.write('<div id=x style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+a_Colour+';font-size:'+i/2+'"></div>');

document.write('<div id=y style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+b_Colour+';font-size:'+i/2+'"></div>');

document.write('<div id=z style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+c_Colour+';font-size:'+i/2+'"></div>');

}

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

}

function prepos(){

var ntscp=document.layers;

var msie=document.all;

if (document.layers){

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

{

 if (i < amount-1)

 {

 ntscp['nsa'+i].top=ntscp['nsa'+(i+1)].top;ntscp['nsa'+i].left=ntscp['nsa'+(i+1)].left;

 ntscp['nsb'+i].top=ntscp['nsb'+(i+1)].top;ntscp['nsb'+i].left=ntscp['nsb'+(i+1)].left;

 ntscp['nsc'+i].top=ntscp['nsc'+(i+1)].top;ntscp['nsc'+i].left=ntscp['nsc'+(i+1)].left;

 }

else 

 {

 ntscp['nsa'+i].top=YDummy[0];ntscp['nsa'+i].left=XDummy[0];

 ntscp['nsb'+i].top=YDummy[1];ntscp['nsb'+i].left=XDummy[1];

 ntscp['nsc'+i].top=YDummy[2];ntscp['nsc'+i].left=XDummy[2];

 }

}

}

else if (document.all){

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

{

 if (i < amount-1)

 {

 msie.x[i].style.top=msie.x[i+1].style.top;msie.x[i].style.left=msie.x[i+1].style.left;

 msie.y[i].style.top=msie.y[i+1].style.top;msie.y[i].style.left=msie.y[i+1].style.left;

 msie.z[i].style.top=msie.z[i+1].style.top;msie.z[i].style.left=msie.z[i+1].style.left;

 }

else

 {

 msie.x[i].style.top=YDummy[0];msie.x[i].style.left=XDummy[0];

 msie.y[i].style.top=YDummy[1];msie.y[i].style.left=XDummy[1];

 msie.z[i].style.top=YDummy[2];msie.z[i].style.left=XDummy[2];

 }

}

}

setTimeout("prepos()",10);

}

function Start(){

swirl(),prepos()

}

window.onload=Start;

// -->

</script>

 

 

0 Comments

Tue

17

Mar

2009

85、鼠标的小尾巴

85、鼠标的小尾巴

脚本说明:

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

<script LANGUAGE="JavaScript">

<!--

Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff')

amount=10;

Xpos = 0;

Ypos = 0;

if (document.layers){

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

{document.write('<layer name=nstrs'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor=#ff0000></layer>')}

window.captureEvents(Event.MOUSEMOVE);

function nsMouse(evnt){

Xpos = window.pageYOffset+evnt.pageX+1;

Ypos = window.pageYOffset+evnt.pageY+4;

}

window.onMouseMove = nsMouse;

}

else if (document.all){

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

+'<div id="c" style="position:relative">');

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

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

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

function ieMouse(){

Ypos = document.body.scrollTop+event.y+4;

Xpos = document.body.scrollLeft+event.x+1;

}

document.onmousemove = ieMouse;

}

 

function animateLogo(){

if (document.layers){

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

{

var randCol=Math.round(Math.random()*8);

document.layers['nstrs'+i].bgColor=Clrs[randCol];

 

if (i < amount-1)

 {

 document.layers['nstrs'+i].top=document.layers['nstrs'+(i+1)].top;

 document.layers['nstrs'+i].left=document.layers['nstrs'+(i+1)].left;

 }

else 

 {

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

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

 }

}

}

else if (document.all){

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

{

var randCol=Math.round(Math.random()*8);

ieDiv.all.c.all[i].style.background=Clrs[randCol];

if (i < amount-1)

 {

 ieDiv.all.c.all[i].style.top=ieDiv.all.c.all[i+1].style.top;

 ieDiv.all.c.all[i].style.left=ieDiv.all.c.all[i+1].style.left;

 }

else

 {

 ieDiv.all.c.all[i].style.top = Ypos;

 ieDiv.all.c.all[i].style.left =Xpos;

 }

}

}

setTimeout("animateLogo()",10);

}

animateLogo();

// -->

</script>

 

1 Comments

Tue

17

Mar

2009

84、飘浮的气泡

84、飘浮的气泡

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

Image0 = new Image();

Image0.src = "bubBlack.gif";

Amount = 20;

Ymouse = -50;

Xmouse = -50;

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;

(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;

function Mouse(evnt) {

Ymouse=(document.layers)?evnt.pageY-20:event.y-20;

Xmouse=(document.layers)?evnt.pageX:event.x;

}

(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

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

Ypos[i] = Ymouse;

Xpos[i] = Xmouse;

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

Cstep[i] = 0;

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

grow[i] = 8;

nsSize[i] = Math.random()*15+5;

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=0><img src="+Image0.src+" name='N' width="+nsSize[i]+" height="+nsSize[i]+"></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:0px;left:0px;filter:alpha(opacity=90)">');

}

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

}

function MouseBubbles() {

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

var wscrll = (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] * 4);

Ypos[i] += sy;

Xpos[i] += sx;

if (Ypos[i] < -40) {

Ypos[i] = Ymouse;

Xpos[i] = Xmouse;

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

grow[i] = 8;

nsSize[i] = Math.random() * 15 + 5;

}

if (ns) {

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

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

}

else {

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

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

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

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

}

grow[i] += rate[i];

Cstep[i] += Step[i];

if (grow[i] > 24) grow[i] = 25;

}

setTimeout('MouseBubbles()', 10);

}

MouseBubbles();

//  End -->

</script>

 

0 Comments

Tue

17

Mar

2009

83、鼠标上变化的文字

83、鼠标上变化的文字

脚本说明:

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

<SCRIPT language="JavaScript1.2">

<!--

 

var scroller_msg='Hi,网络编程站欢迎你的光临!'

 

var dismissafter=0

 

var initialvisible=0

if (document.all)

document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:1px solid black;font-size:14px;background-color:white;visibility:hidden">'+scroller_msg+'</marquee>')

 

function followcursor(){

//move cursor function for IE

 

if (initialvisible==0){

curscroll.style.visibility="visible"

initialvisible=1

}

 

curscroll.style.left=document.body.scrollLeft+event.clientX+10

curscroll.style.top=document.body.scrollTop+event.clientY+10

}

 

function dismissmessage(){

curscroll.style.visibility="hidden"

}

 

 

if (document.all){

document.onmousemove=followcursor

document.ondblclick=dismissmessage

if (dismissafter!=0)

setTimeout("dismissmessage()",dismissafter*1000)

}

 

 

 

//-->

 </SCRIPT>

 

0 Comments

Tue

17

Mar

2009

82、鼠标旋转效果

82、鼠标旋转效果

脚本说明:

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

<script language="JavaScript">

<!--

//Pick your own colours below!!

CoLoUrS=new Array('00ff00','ff00ff','fff000','3366ff');

 

var step=0.3,a_StEp=0.05,RunTime=0,currStep=0,Xpos=0,Ypos=0,cntr=70,count_a=0;

var count=0,move=1,Ay=0,Ax=0,dots=16;var x;brwsr=(document.layers)?1:0;

if (brwsr){

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

document.write('<LAYER NAME="a'+i+'" LEFT=0 TOP=0 BGCOLOR=#3366ff CLIP="0,0,3,3"></LAYER>');

}

window.captureEvents(Event.MOUSEMOVE);

function nsMouse(evnt){

 Xpos = evnt.pageX;

 Ypos = evnt.pageY;

 }

window.onMouseMove = nsMouse

}

else{

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

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

document.write('<div id="ieDivs" style="position:absolute;top:0px;left:0px;width:3px;height:3px;background:#3366ff;font-size:3px"></div>');

}

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

function ieMouse(){

 Ypos=event.y;

 Xpos=event.x;

 }

window.document.onmousemove = ieMouse

}

 

function MouseFollow(){

ay = Math.round(Ay+=(Ypos- Ay)* 4/40);

ax = Math.round(Ax+=(Xpos- Ax)* 4/40);

setTimeout('MouseFollow()',10);

}

 

function colourStep(){

count+=move;

if (count >= dots) {count=0;count_a+=move}

if (count_a == CoLoUrS.length) count_a=0;

if (brwsr) document.layers["a"+count].bgColor=CoLoUrS[count_a];

else ieDivs[count].style.background=CoLoUrS[count_a];

setTimeout('colourStep()',100)

}

 

function TwistnSpin(){

if (!brwsr) ys.style.top=document.body.scrollTop;

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

 {

 var allLayers=(document.layers)?document.layers["a"+i]:ieDivs[i].style;

 allLayers.top=ay+cntr*Math.cos((currStep+i*4)/10.2)*Math.sin(currStep/20);

 allLayers.left=ax+cntr*Math.sin((currStep+i*4)/10.2)*Math.cos(1+currStep/20);

 }

currStep-=step;

setTimeout("TwistnSpin()",10);

}

function CombineNstart(){

MouseFollow();TwistnSpin();colourStep();

}

window.onload=CombineNstart;

// End Pretty -->

</script>

 

0 Comments

Tue

17

Mar

2009

81、跟随鼠标的LOGO

81、跟随鼠标的LOGO

脚本说明:

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

<DIV id=dot0

style="HEIGHT: 0px; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: hidden; WIDTH: 0px"></DIV>

<DIV id=dot1

style="HEIGHT: 0px; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 0px"><IMG

height=30 src="java2000.gif" width=88> </DIV>

<DIV id=dot2

style="HEIGHT: 0px; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 0px"><IMG

height=30 src="java2000.gif" width=88> </DIV>

<SCRIPT language=JavaScript>

<!--

// define number of divs

var nDots = 3;

// define starting position of image

var Xpos = 0;

var Ypos = 0;

// define speed of moving image

var DELTAT = .01;

// define how far the image drops from the cursor

var SEGLEN = 10;

// define how big is the loop the image makes around the cursor

var SPRINGK = 10;

// the greater the mass the slower the speed of image

var MASS = 1;

// the greater the gravity the smaller is the loop

var GRAVITY = 50;

// the greater the resistance the slower the speed of image

var RESISTANCE = 10;

var STOPVEL = 0.1;

var STOPACC = 0.1;

var DOTSIZE = 11;

// define the size of the bounces of the image

var BOUNCE = 0.75;

var isNetscape = navigator.appName=="Netscape";

var followmouse = true;

var dots = new Array();

init();

function init()

{

var i = 0;

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

dots[i] = new dot(i);

}

if (!isNetscape) {

//

}

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

dots[i].obj.left = dots[i].X;

dots[i].obj.top = dots[i].Y;

}

if (isNetscape) {

startanimate();

} else {

setTimeout("startanimate()", 3000);

}

}

function dot(i)

{

this.X = Xpos;

this.Y = Ypos;

this.dx = 0;

this.dy = 0;

if (isNetscape) {  

this.obj = eval("document.dot" + i);

} else {

this.obj = eval("dot" + i + ".style");

}

}

function startanimate() {      

    setInterval("animate()", 20);

}

function setInitPositions(dots)

{

var startloc = document.all.tags("LI");

var i = 0;

for (i = 0; i < startloc.length && i < (nDots - 1); i++) {

dots[i+1].X = startloc[i].offsetLeft

startloc[i].offsetParent.offsetLeft - DOTSIZE;

dots[i+1].Y = startloc[i].offsetTop +

startloc[i].offsetParent.offsetTop + 2*DOTSIZE;

}

dots[0].X = dots[1].X;

dots[0].Y = dots[1].Y - SEGLEN;

}

function MoveHandler(e)

{

Xpos = e.pageX;

Ypos = e.pageY;      

return true;

}

function MoveHandlerIE() {

Xpos = window.event.x + document.body.scrollLeft;

Ypos = window.event.y + document.body.scrollTop;     

}

if (isNetscape) {

document.captureEvents(Event.MOUSEMOVE);

document.onMouseMove = MoveHandler;

} else { document.onmousemove = MoveHandlerIE; }

function vec(X, Y)

{

this.X = X;

this.Y = Y;

}

function springForce(i, j, spring)

{

var dx = (dots[i].X - dots[j].X);

var dy = (dots[i].Y - dots[j].Y);

var len = Math.sqrt(dx*dx + dy*dy);

if (len > SEGLEN) {

var springF = SPRINGK * (len - SEGLEN);

spring.X += (dx / len) * springF;

spring.Y += (dy / len) * springF;

}

}

function animate() {   

var start = 0;

if (followmouse) {

dots[0].X = Xpos;

dots[0].Y = Ypos;      

start = 1;

}

for (i = start ; i < nDots; i++ ) {

var spring = new vec(0, 0);

if (i > 0) {

springForce(i-1, i, spring);

}

if (i < (nDots - 1)) {

springForce(i+1, i, spring);

}

var resist = new vec(-dots[i].dx * RESISTANCE,-dots[i].dy * RESISTANCE);

var accel = new vec((spring.X + resist.X)/ MASS,(spring.Y + resist.Y)/ MASS + GRAVITY);

   dots[i].dx += (DELTAT * accel.X);

   dots[i].dy += (DELTAT * accel.Y);

if (Math.abs(dots[i].dx) < STOPVEL && Math.abs(dots[i].dy) < STOPVEL &&

Math.abs(accel.X) < STOPACC &&

Math.abs(accel.Y) < STOPACC) {

dots[i].dx = 0;

dots[i].dy = 0;

}

dots[i].X += dots[i].dx;

dots[i].Y += dots[i].dy;

var height, width;

if (isNetscape) {

height = window.innerHeight + document.scrollTop;

width = window.innerWidth + document.scrollLeft;

} else {       

height = document.body.clientHeight + document.body.scrollTop;

width = document.body.clientWidth + document.body.scrollLeft;

}

if (dots[i].Y >=  height - DOTSIZE - 1) {

if (dots[i].dy > 0) {

dots[i].dy = BOUNCE * -dots[i].dy;

}

dots[i].Y = height - DOTSIZE - 1;

}

if (dots[i].X >= width - DOTSIZE) {

if (dots[i].dx > 0) {

dots[i].dx = BOUNCE * -dots[i].dx;

}

dots[i].X = width - DOTSIZE - 1;

}

if (dots[i].X < 0) {

if (dots[i].dx < 0) {

dots[i].dx = BOUNCE * -dots[i].dx;

}

dots[i].X = 0;

}

dots[i].obj.left = dots[i].X;                  

dots[i].obj.top =  dots[i].Y;          

}

}

// -->

</SCRIPT>

 

0 Comments

Tue

17

Mar

2009

80、随鼠标的变化色块

80、随鼠标的变化色块

脚本说明:

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

<script language="JavaScript">

<!--

if (document.all){

//To add more stars simply add more colours in below array!!

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

 

//Alter nothing below!!

amount=colours.length;

YgetDelay=0,XgetDelay=0,Ydelay=0,Xdelay=0,step=0.2,currStep=0,my=0,mx=0;

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

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

document.write('<div id="iestars" style="position:absolute;top:0px;left:0px;height:50px;width:50px;font-family:Courier New;font-size:5px;color:'+colours[i]+';padding-top:20px;text-align:center">.</div>');

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

ini=1;

gstep=1;

function iMouse(){

my=event.y;mx=event.x;

}

document.onmousemove=iMouse

function dim(){

ini-=gstep;

dt=setTimeout('dim()',10);

if (ini < 2){

clearTimeout(dt);

glow();

}

}

function glow(){

ini+=gstep;

gt=setTimeout('glow()',10);

if (ini > 14){

clearTimeout(gt);

dim();

}

}

function stars(){

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

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

 {

 var layer=iestars[i].style;

 layer.filter='glow(color='+colours[i]+', strength='+ini+')';

 layer.top= Ydelay+100*Math.sin((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10);

 layer.left=Xdelay+180*Math.cos((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10);

 }

currStep+=step;

}

function delay(){

Ydelay = YgetDelay+=(my-YgetDelay)*1/20;

Xdelay = XgetDelay+=(mx-XgetDelay)*1/20;

stars();

setTimeout('delay()',10);

}

delay();

glow();

}

//-->

</script>

 

0 Comments

Tue

17

Mar

2009

79、点击变色的链接文字

79、点击变色的链接文字

<html>

 

<head>

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

<title>网页特效---点击变色的链接文字</title>

</head>

 

<body>

 

<p onMouseMove="hello()">将鼠标移到这里看看<p><p></p>

<script language="VBScript">

sub hello

document.fgColor=int(256*256*256*rnd)

end sub

</script>

 

</body>

 

</html>

 

<a href="http://huicui.jimdo.com/">欢迎访问网页特效代码huicui.jimdo.com/</a>

 

0 Comments

Tue

17

Mar

2009

78、鼠标放上去打开新页面

78、鼠标放上去打开新页面

脚本说明:

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

<SCRIPT Language="JavaScript">function winopen () {msg=open("http://www.7stk.com/","NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=400,height=260");}</SCRIPT>

 

 

 

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

<a href="" onMouseOver="winopen(); return true;"><IMG SRC="shu.gif" border="0"></a>

 

0 Comments

Tue

17

Mar

2009

77、右键页面就自动跳转

77、右键页面就自动跳转

脚本说明:

 

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

 

<script language="JavaScript">

 

 

 

if (navigator.appName.indexOf("Internet Explorer") != -1)      

 

       document.onmousedown = noSourceExplorer;

 

      

 

function noSourceExplorer()

 

{

 

       if (event.button == 2 | event.button == 3)

 

       {

 

              alert("禁止右键...去网页特效代码!");

 

              location.replace("http://www.7stk.com");

 

       }

 

}

 

</script>

 

 

 

 

0 Comments

Tue

17

Mar

2009

76、鼠标激活警告框

76、鼠标激活警告框

脚本说明:

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

<a href="" onMouseOver="alert('网页特效代码:http://www3.jimdo.com');return true;">记住本站域名</a>

 

0 Comments

Tue

17

Mar

2009

75、跟随鼠标的星星

75、跟随鼠标的星星

脚本说明:

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

<script>

/*

Scrolling Image Map/Text Link Tooltip Script-

Special Thanks to: Rob(http://rob.yeah.net)

                   Miss Ann(http://annworld.126.com)

*/

 

if (!document.layers&&!document.all)

event="test"

function showtip2(current,e,text){

 

if (document.all&&document.readyState=="complete"){

document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'

document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10

document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10

document.all.tooltip2.style.visibility="visible"

}

 

else if (document.layers){

document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')

document.tooltip2.document.nstip.document.close()

document.tooltip2.document.nstip.left=0

currentscroll=setInterval("scrolltip()",100)

document.tooltip2.left=e.pageX+10

document.tooltip2.top=e.pageY+10

document.tooltip2.visibility="show"

}

}

function hidetip2(){

if (document.all)

document.all.tooltip2.style.visibility="hidden"

else if (document.layers){

clearInterval(currentscroll)

document.tooltip2.visibility="hidden"

}

}

 

function scrolltip(){

if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)

document.tooltip2.document.nstip.left-=5

else

document.tooltip2.document.nstip.left=150

}

</script>

<script language="JavaScript">

function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) { //v1.2

//copyright (c)1999 Yaromat, Jaro von Flocken

 if ((document.layers)||(document.all)){

  with (Math) {yynextx= eval(yyfnx)}

  with (Math) {yynexty= eval(yyfny)}

  yycnt=(yyloop && yycnt>=yystep*yybilder)?0:yycnt+yystep;

  if (document.layers){

    eval(yydiv+".top="+(yynexty+yytop))

    eval(yydiv+".left="+(yynextx+yyleft))

  }

  if (document.all){

    eval("yydiv=yydiv.replace(/.layers/gi, '.all')");

    eval(yydiv+".style.pixelTop="+(yynexty+yytop));

    eval(yydiv+".style.pixelLeft="+(yynextx+yyleft));

  }

  argStr='YY_Layerfx('+yyleft+','+yytop+',"'+yyfnx+'","'+yyfny+'","'+yydiv+'",'+yybilder+','+yyloop+','+yyto+','+yycnt+','+yystep+')';

  if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");}

 }

 

}

function YY_Mousetrace(evnt) { //v1.2 copyright (c)1999 Yaromat

 if (yyns4)

  {if (evnt.pageX) {yy_ml=evnt.pageX;  yy_mt=evnt.pageY;}  }

 else{

   yy_ml=(event.clientX + document.body.scrollLeft);

   yy_mt=(event.clientY + document.body.scrollTop);

 }

 if (yy_tracescript)eval(yy_tracescript)

}

</script>

<script language="JavaScript">

function PopWin()

{

       var PopWin = window.open("new.htm","PopWin","toolbar=no,directries=no,scrollBars=yes,height=350,width=400");

}

</script>

      <div id="tooltip2"

style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:lightyellow">

        <layer name="nstip" width="1000px" bgcolor="lightyellow"> </layer>

      </div>

      <div id="yyd0"

style="position:absolute; left:10px; top:50px; width:3px; height:3px; z-index:1; background-color: #19636c; layer-background-color: #19636c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

      <div

id="yyd1"

style="position:absolute; left:20px; top:50px; width:3px; height:3px; z-index:1; background-color: #708574; layer-background-color: #708574; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

      <div

id="yyd2"

style="position:absolute; left:30px; top:50px; width:3px; height:3px; z-index:1; background-color: #379bbf; layer-background-color: #379bbf; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

      <div

id="yyd3"

style="position:absolute; left:40px; top:50px; width:3px; height:3px; z-index:1; background-color: #25184c; layer-background-color: #25184c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

      <div

id="yyd4"

style="position:absolute; left:50px; top:50px; width:3px; height:3px; z-index:1; background-color: #31bd3c; layer-background-color: #31bd3c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

      <div

id="yyd5"

style="position:absolute; left:60px; top:50px; width:3px; height:3px; z-index:1; background-color: #c11efd; layer-background-color: #c11efd; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

        <script>

var yyns4=window.Event?true:false; var yy_mt = 0; var yy_ml = 0;

document.onmousemove = YY_Mousetrace;

yy_tracescript = '';

 

if (yyns4){ document.captureEvents(Event.MOUSEMOVE);

  YY_Mousetrace('',',document.YY_Mousetrace1')}

 

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/39.83007847812662))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/34.224861639800686))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd0\']',2000,true,80,0,1);

 

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/27.66510707209673))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/9.240632767417667))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd1\']',2000,true,80,0,1);

 

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/16.45318944579641))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/16.0564452288292))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd2\']',2000,true,80,0,1);

 

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/6.95348954836835))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/44.13697049887155))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd3\']',2000,true,80,0,1);

 

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/33.90077294583733))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/2.2378828869411587))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd4\']',2000,true,80,0,1);

 

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/37.858312521039835))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/18.083839795990098))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd5\']',2000,true,80,0,1);

</script>

        <script>

/*

Scrolling Image Map/Text Link Tooltip Script-

Special Thanks to: Rob(http://rob.yeah.net)

                   Miss Ann(http://annworld.126.com)

*/

 

if (!document.layers&&!document.all)

event="test"

function showtip2(current,e,text){

 

if (document.all&&document.readyState=="complete"){

document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'

document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10

document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10

document.all.tooltip2.style.visibility="visible"

}

 

else if (document.layers){

document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')

document.tooltip2.document.nstip.document.close()

document.tooltip2.document.nstip.left=0

currentscroll=setInterval("scrolltip()",100)

document.tooltip2.left=e.pageX+10

document.tooltip2.top=e.pageY+10

document.tooltip2.visibility="show"

}

}

function hidetip2(){

if (document.all)

document.all.tooltip2.style.visibility="hidden"

else if (document.layers){

clearInterval(currentscroll)

document.tooltip2.visibility="hidden"

}

}

 

function scrolltip(){

if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)

document.tooltip2.document.nstip.left-=5

else

document.tooltip2.document.nstip.left=150

}

</script>

        <script language="JavaScript">

function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) { //v1.2

//copyright (c)1999 Yaromat, Jaro von Flocken

 if ((document.layers)||(document.all)){

  with (Math) {yynextx= eval(yyfnx)}

  with (Math) {yynexty= eval(yyfny)}

  yycnt=(yyloop && yycnt>=yystep*yybilder)?0:yycnt+yystep;

  if (document.layers){

    eval(yydiv+".top="+(yynexty+yytop))

    eval(yydiv+".left="+(yynextx+yyleft))

  }

  if (document.all){

    eval("yydiv=yydiv.replace(/.layers/gi, '.all')");

    eval(yydiv+".style.pixelTop="+(yynexty+yytop));

    eval(yydiv+".style.pixelLeft="+(yynextx+yyleft));

  }

  argStr='YY_Layerfx('+yyleft+','+yytop+',"'+yyfnx+'","'+yyfny+'","'+yydiv+'",'+yybilder+','+yyloop+','+yyto+','+yycnt+','+yystep+')';

  if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");}

 }

 

}

function YY_Mousetrace(evnt) { //v1.2 copyright (c)1999 Yaromat

 if (yyns4)

  {if (evnt.pageX) {yy_ml=evnt.pageX;  yy_mt=evnt.pageY;}  }

 else{

   yy_ml=(event.clientX + document.body.scrollLeft);

   yy_mt=(event.clientY + document.body.scrollTop);

 }

 

 if (yy_tracescript)eval(yy_tracescript)

}

</script>

        <script language="JavaScript">

function PopWin()

{

       var PopWin = window.open("new.htm","PopWin","toolbar=no,directries=no,scrollBars=yes,height=350,width=400");

}

</script>

0 Comments

Tue

17

Mar

2009

74、点击右键会自动打开

74、点击右键会自动打开

脚本说明:

 

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

 

<script language=JavaScript1.2>

 

if (document.all)

 

document.body.onmousedown=new Function("if (event.button==2||event.button==3)window.external.addFavorite('http://www.7stk.com','网页特效代码')")

 

</script>

 

 

0 Comments

Tue

17

Mar

2009

73、各种形状的鼠标

73、各种形状的鼠标

脚本说明:

 

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

 

<table width="53%" border="0">

 

      <tr>

 

        <td width="51%" height="25">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:hand">style="cursor:hand"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="25">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:crosshair">style="cursor:crosshair"</a></b></font></div>

 

        </td>

 

      </tr>

 

      <tr>

 

        <td width="51%" height="29" valign="top">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:text">style="cursor:text"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="29">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:wait">style="cursor:wait"</a></b></font></div>

 

        </td>

 

      </tr>

 

      <tr>

 

        <td width="51%" height="29" valign="top">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:move">style="cursor:move"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="29">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:help">style="cursor:help"</a></b></font></div>

 

        </td>

 

      </tr>

 

      <tr>

 

        <td width="51%" height="29" valign="top">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:e-resize">style="cursor:e-resize"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="29">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:n-resize">style="cursor:n-resize"</a></b></font></div>

 

        </td>

 

      </tr>

 

      <tr>

 

        <td width="51%" height="29" valign="top">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:nw-resize">style="cursor:nw-resize"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="29">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:w-resize"">style="cursor:w-resize"</a></b></font></div>

 

        </td>

 

      </tr>

 

      <tr>

 

        <td width="51%" height="29" valign="top">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:s-resize">style="cursor:s-resize"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="29">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:se-resize">style="cursor:se-resize"</a></b></font></div>

 

        </td>

 

      </tr>

 

      <tr>

 

        <td width="51%" height="29" valign="top">

 

          <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b><a href="cursor.htm" style="cursor:sw-resize">style="cursor:sw-resize"</a></b></font></div>

 

        </td>

 

        <td width="49%" valign="top" height="29">

 

          <div align="left"></div>

 

        </td>

 

      </tr>

 

    </table>

 

 

0 Comments

Tue

17

Mar

2009

72、非图片鼠标跟踪器

72、非图片鼠标跟踪器

脚本说明:

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

<STYLE TYPE="text/css">

<!--

 

BODY{

overflow:scroll;

overflow-x:hidden;

}

 

.s1

{

  position  : absolute;

  font-size : 12pt;

  color     : blue;

  visibility: hidden;

}

 

.s2

{

  position  : absolute;

  font-size : 20pt;

  color     : red;

       visibility : hidden;

}

 

.s3

{

  position  : absolute;

  font-size : 16pt;

  color     : gold;

       visibility : hidden;

}

 

.s4

{

  position  : absolute;

  font-size : 14pt;

  color     : lime;

       visibility : hidden;

}

-->

</STYLE>

 

 

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

<DIV ID="div1" CLASS="s1">*</DIV>

<DIV ID="div2" CLASS="s2">*</DIV>

<DIV ID="div3" CLASS="s3">*</DIV>

<DIV ID="div4" CLASS="s4">*</DIV>

 

 

<script language="javascript" type="text/javascript" class="s5">

 

var nav = (document.layers);

var tmr = null;

var spd = 50;

var x = 0;

var x_offset = 5;

var y = 0;

var y_offset = 15;

 

if(nav) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = get_mouse;

 

function get_mouse(e)

{   

  x = (nav) ? e.pageX : event.clientX+document.body.scrollLeft;

  y = (nav) ? e.pageY : event.clientY+document.body.scrollTop;

  x += x_offset;

  y += y_offset;

  beam(1);    

}

 

function beam(n)

{

  if(n<5)

  {

    if(nav)

    {

      eval("document.div"+n+".top="+y);

      eval("document.div"+n+".left="+x);

      eval("document.div"+n+".visibility='visible'");

    } 

    else

    {

      eval("div"+n+".style.top="+y);

      eval("div"+n+".style.left="+x);

      eval("div"+n+".style.visibility='visible'");

    }

    n++;

    tmr=setTimeout("beam("+n+")",spd);

  }

  else

  {

     clearTimeout(tmr);

     fade(4);

  }  

}

 

function fade(n)

{

  if(n>0)

  {

    if(nav)eval("document.div"+n+".visibility='hidden'");

    else eval("div"+n+".style.visibility='hidden'");

    n--;

    tmr=setTimeout("fade("+n+")",spd);

  }

  else clearTimeout(tmr);

}

 

// -->

</script>

 

0 Comments

Tue

17

Mar

2009

71、显示链接特征

71、显示链接特征

脚本说明:

 

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

 

 <SCRIPT language=javascript>

 

function mOver(){

 

document.all.tags("A").item(0).style.textDecoration="none";

 

}

 

</SCRIPT>

 

 

 

<STYLE type=text/css>A:hover {

 

       COLOR: orange

 

}

 

</STYLE>

 

 

 

<STYLE type=text/css>A:hover {

 

       CURSOR: ne-resize

 

}

 

A {

 

       TEXT-DECORATION: none

 

}

 

</STYLE>

 

 

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

 

<A href="http://www3.jimdo.com/">网页特效代码</A>

 

0 Comments

Tue

17

Mar

2009

70、随鼠标的彩色字符

70、随鼠标的彩色字符

脚本说明:

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

<STYLE>.spanstyle {

       COLOR: #0066ff; FONT-FAMILY: 隶书; FONT-SIZE: 14pt; FONT-WEIGHT: normal; POSITION: absolute; TOP: -50px; VISIBILITY: visible

}

</STYLE>

 

 

 

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

<SCRIPT language=javascript>

       var message="        javascript   !";

       var x,y;

       var step=12;

       var flag=0;

 

       message=message.split("");

       var xpos=new Array();

       for (i=0;i<=message.length-1;i++) {

              xpos[i]=-50;

       }

 

       var ypos=new Array();

       for (i=0;i<=message.length-1;i++) {

              ypos[i]=-50;

       }

 

       function handlerMM(e) {

              x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX+10;

              y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY;

              flag=1;

       }

 

       function makesnake() {

              if (flag==1 && document.all) {

                         for (i=message.length-1; i>=1; i--) {

                          xpos[i]=xpos[i-1]+step;

                            ypos[i]=ypos[i-1];

                         }

                     xpos[0]=x+step;

                     ypos[0]=y;

 

                     for (i=0; i<=message.length-1; i++) {

                                var thisspan = eval("span"+(i)+".style");

                                thisspan.posLeft=xpos[i];

                            thisspan.posTop=ypos[i];

                            thisspan.color=Math.random() * 255 * 255 * 255 + Math.random() * 255 * 255 + Math.random() * 255;

                         }

              }

              else if (flag==1 && document.layers) {

                         for (i=message.length-1; i>=1; i--) {

                          xpos[i]=xpos[i-1]+step;

                            ypos[i]=ypos[i-1];

                         }

                     xpos[0]=x+step;

                     ypos[0]=y;

 

                     for (i=0; i<message.length-1; i++) {

                                var thisspan = eval("document.span"+i);

                                thisspan.left=xpos[i];

                            thisspan.top=ypos[i];

                            thisspan.color=Math.random() * 255 * 255 * 255 + Math.random() * 255 * 255 + Math.random() * 255;

                     }

              }

       }

</SCRIPT>

 

<SCRIPT language=javascript>

       for (i=0;i<=message.length-1;i++) {

                  document.write("<span id='span"+i+"' class='spanstyle'>");

              document.write(message[i]);

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

       }

 

       if (document.layers) {

              document.captureEvents(Event.MOUSEMOVE);

       }

       document.onmousemove = handlerMM;

</SCRIPT>

 

<SCRIPT language=javascript>

       function pageonload() {

              makesnake();

              window.setTimeout("pageonload();", 2);

       }

</SCRIPT>

 

第三步:<body>改为

<body bgcolor="#fef4d9" onload=javascript:pageonload()>

 

 

0 Comments

Tue

17

Mar

2009

69、鼠标会被炸掉

69、鼠标会被炸掉

脚本说明:

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

<script>

picFollow = new Image();

picFollow.src = "bomb.gif";

picExplosion = new Image();

picExplosion.src = "explode.gif";

document.onmousemove = getMousePosition;

document.onmouseout = pauseBomb;

document.write("<div id=\"diva\" style=\"position:absolute\">");

document.write("<img name=\"pic\"src=" + picFollow.src + "></div>");

var picX = 20;

var picY = 100;

var step = 10;

var speed = 100;

var tolerance = step/2 +1;

var mouseX = 0;

var mouseY = 0;

var mouseOut = true;

var followMouse = false;

myInterval = setInterval('moveBomb()', speed);

function pauseBomb() {

mouseOut = true;

}

function getMousePosition(e) {

mouseX = window.event.x + document.body.scrollLeft;

mouseY = window.event.y + document.body.scrollTop;

mouseOut = false;

if (followMouse) {

diva.style.left = mouseX - pic.width / 2;

diva.style.top = mouseY - pic.height / 2;

   }

}

function calcNewPos() {

if (mouseX == picX)

return;

arg = (mouseY-picY) / (mouseX-picX);

mult = 1;

if (mouseX - picX < 0)

mult = -1;

alpha = Math.atan(arg);

dx = mult * step * Math.cos(alpha);

dy = mult * step * Math.sin(alpha);

picX += dx;

picY += dy;

}

function collision() {

if ((Math.abs(picX-mouseX) < tolerance) && (Math.abs(picY-mouseY) < tolerance) && (!mouseOut))

return true;

return false;

}

function hideAnimation() {

diva.style.visibility = "hidden";

}

function moveBomb() {

calcNewPos();

window.status = "("+mouseX+","+mouseY+")";

diva.style.left = picX - pic.width / 2;

diva.style.top = picY - pic.height / 2;

if (collision()) {

clearInterval(myInterval);

pic.src = picExplosion.src;

followMouse = true;

setTimeout('hideAnimation()', 2000);

   }

}

</script>

 

0 Comments

Tue

17

Mar

2009

68、跟随鼠标的花絮

68、跟随鼠标的花絮

脚本说明:

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

<LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a7" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a8" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a9" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a10" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a11" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a12" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a13" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a14" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a15" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a16" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a17" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a18" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a19" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a20" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a21" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a22" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a23" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a24" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a25" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a26" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a27" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a28" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a29" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a30" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a31" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a32" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a33" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a34" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a35" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a36" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a37" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a38" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a39" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a40" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a41" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a42" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a43" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a44" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a45" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<LAYER NAME="a46" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,3,3">

</LAYER>

<script language="JavaScript">

<!--

if (document.all){

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

for (xy=0;xy<47;xy++)

document.write('<div style="position:relative;width:3px;height:3px;background:#FFFF00;font-size:2px;visibility:visible"></div>')

document.write('</div>')

}

if (document.layers)

{window.captureEvents(Event.MOUSEMOVE);}

var yBase = 200;

var xBase = 200;

var yAmpl = 10;

var yMax = 40;

var step = .2;

var ystep = .5;

var currStep = 0;

var tAmpl=1;

var Xpos = 1;

var Ypos = 1;

var i = 0;

var j = 0;

 

if (document.all)

{

function MoveHandler(){

Xpos = document.body.scrollLeft+event.x;

Ypos = document.body.scrollTop+event.y;

}

document.onmousemove = MoveHandler;

}

 

else if (document.layers)

{

function xMoveHandler(evnt){

Xpos = evnt.pageX;

Ypos = evnt.pageY;

}

window.onMouseMove = xMoveHandler;

}

 

 

function animateLogo() {

if (document.all)

{

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

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

}

else if (document.layers)

{

yBase = window.innerHeight/4 ;

xBase = window.innerWidth/4;

}

 

if (document.all)

{

var totaldivs=document.all.starsDiv.all.length

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

{

var tempdiv=document.all.starsDiv.all[i].style

tempdiv.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);

tempdiv.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);

}

}

 

else if (document.layers)

{

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

{

var templayer="a"+j

document.layers[templayer].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);

document.layers[templayer].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);

}

}

currStep += step;

setTimeout("animateLogo()", 15);

}

animateLogo();

// -->

</script>

 

 

0 Comments

Tue

17

Mar

2009

67、跟随鼠标的时钟

67、跟随鼠标的时钟

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

colors = new Array('330099','00ff00','ff00ff');  //Clock face colors.

sCol = 'ff00ff';  //seconds colour.

mCol = '00ff00';  //minutes colour.

hCol = '330099';  //hours colour.

//Alter nothing below!

H = 'Hours..';

H = H.split('');

H = H.reverse();

M = 'Minutes..';

M = M.split('');

M = M.reverse();

S = 'Seconds..';

S = S.split('');

S = S.reverse();

dots = 12;

var Ypos = 0,Xpos = 0,Ybase = 0,Xbase = 0;

var ay = 0, ax = 0, Ay = 0, Ax = 0, by = 0, bx = 0, By = 0, Bx = 0, cy = 0, cx = 0, Cy = 0, Cx = 0, dy = 0, dx = 0, Dy = 0, Dx = 0;

count = 0;

count_a = 0;

move = 1;

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

viz = (document.layers)?'hide':'hidden';

if (ns) {

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

document.write('<layer name=nface'+i+' top=0 left=0 bgcolor=#ffffff clip="0,0,3,3"></layer>');

for (i = 0; i < S.length; i++)

document.write('<layer name=nx'+i+' top=0 left=0 width=36 height=36><font face=Verdana size=2 color='+sCol+'><center>'+S[i]+'</center></font></layer>');

for (i = 0; i < M.length; i++)

document.write('<layer name=ny'+i+' top=0 left=0 width=36 height=36><font face=Verdana size=2 color='+mCol+'><center>'+M[i]+'</center></font></layer>');

for (i = 0; i < H.length; i++)

document.write('<layer name=nz'+i+' top=0 left=0 width=36 height=36><font face=Verdana size=2 color='+hCol+'><center>'+H[i]+'</center></font></layer>');

}

else{

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

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

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

}

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

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

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

document.write('<div id="x" style="position:absolute;width:36px;height:36px;font-family:Verdana;font-size:12px;color:'+sCol+';text-align:center;padding-top:10px">'+S[i]+'</div>');

}

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

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

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

document.write('<div id="y" style="position:absolute;width:36px;height:36px;font-family:Verdana;font-size:12px;color:'+mCol+';text-align:center;padding-top:10px">'+M[i]+'</div>');

}

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

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

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

document.write('<div id="z" style="position:absolute;width:36px;height:36px;font-family:Verdana;font-size:12px;color:'+hCol+';text-align:center;padding-top:10px">'+H[i]+'</div>');

}

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

}

if (ns) {

window.captureEvents(Event.MOUSEMOVE);

function nsMouse(evnt) {

Ypos = evnt.pageY + 100;

Xpos = evnt.pageX + 100;

}

window.onMouseMove = nsMouse;

}

else{

function ieMouse() {

Ypos = event.y + 100;

Xpos = event.x + 100;

}

document.onmousemove = ieMouse;

}

function clock() {

time = new Date ();

secs = time.getSeconds();

sec = -1.57 + Math.PI * secs / 30;

mins = time.getMinutes();

min = -1.57 + Math.PI * mins / 30;

hr = time.getHours();

hrs = -1.575 + Math.PI * hr / 6 + Math.PI * parseInt(time.getMinutes()) / 360;

Ybase = 15;

Xbase = 15;

if (ns) {

document.layers["nx"+0].visibility = viz;

document.layers["ny"+0].visibility = viz;

document.layers["nz"+0].visibility = viz;

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

document.layers["nx"+i].top = ay - 12 + (i * Ybase) * Math.sin(sec);

document.layers["nx"+i].left = ax - 12 + (i * Xbase) * Math.cos(sec);

}

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

document.layers["ny"+i].top = by - 12 + (i * Ybase) * Math.sin(min);

document.layers["ny"+i].left = bx - 12 + (i * Xbase) * Math.cos(min);

}

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

document.layers["nz"+i].top = cy - 12 + (i * Ybase) * Math.sin(hrs);

document.layers["nz"+i].left = cx - 12 + (i * Xbase) * Math.cos(hrs);

}

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

document.layers["nface"+i].top = dy - 2 + (70 * Math.sin(-0.49+dots+i/1.9));

document.layers["nface"+i].left = dx + 4 + (70 * Math.cos(-0.49+dots+i/1.9));

   }

}

else {

var scrll = document.body.scrollTop;

W.style.pixelTop = scrll;

X.style.pixelTop = scrll;

Y.style.pixelTop = scrll;

Z.style.pixelTop = scrll;

x[0].style.visibility=viz;

y[0].style.visibility = viz;

z[0].style.visibility = viz;

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

x[i].style.pixelTop = ay - 12 + (i * Ybase) * Math.sin(sec);

x[i].style.pixelLeft = ax - 12 + (i * Xbase) * Math.cos(sec);

}

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

y[i].style.pixelTop = by - 12 + (i * Ybase) * Math.sin(min);

y[i].style.pixelLeft = bx - 12 + (i * Xbase) * Math.cos(min);

}

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

z[i].style.pixelTop = cy - 12 + (i * Ybase) * Math.sin(hrs);

z[i].style.pixelLeft = cx - 12 + (i * Xbase) * Math.cos(hrs);

}

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

face[i].style.pixelTop = dy + 6 + (70 * Math.sin(-0.49 + dots + i / 1.9));

face[i].style.pixelLeft = dx + 4 + (70 * Math.cos(-0.49 + dots + i / 1.9));

      }

   }

}

function MouseFollow() {

ay = Math.round(Ay += ((Ypos) - Ay) * 4 / 15);

ax = Math.round(Ax += ((Xpos) - Ax) * 4 / 15);

by = Math.round(By += (ay - By) * 4 / 15);

bx = Math.round(Bx += (ax - Bx) * 4 / 15);

cy = Math.round(Cy += (by - Cy) * 4 / 15);

cx = Math.round(Cx += (bx - Cx) * 4 / 15);

dy = Math.round(Dy += (cy - Dy) * 4 / 15);

dx = Math.round(Dx += (cx - Dx) * 4 / 15);

clock();

setTimeout('MouseFollow()',10);

}

function colorstep() {

count +=move;

if (count >= dots) {count=0;count_a += move}

if (count_a == colors.length) count_a = 0;

if (ns) document.layers["nface"+count].bgColor = colors[count_a];

else face[count].style.background = colors[count_a];

setTimeout('colorstep()',100)

}

function StartAll() {

MouseFollow();

colorstep();

}

if (document.layers || document.all) window.onload = StartAll;

//  End -->

</script>

 

0 Comments

Tue

17

Mar

2009

66、大雁跟着鼠标飞舞

66、大雁跟着鼠标飞舞

本说明:

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

<script language="JavaScript">

<!-- 

var images='0109arrow.gif';//Put your image name here!!

var amount=8;       //Number of images here!!

var yBase = 150;

var xBase = 200;

var step = 0.2;

var currStep = 0;

var Xpos = 5;

var Ypos = 5;

var i = 0;

var j = 0;

if (document.all)

{

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

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

for (n=0; n < amount; n++)

document.write('<img src=" '+images+'" style="position:absolute;top:0px;left:0px">')

document.write('</div>')

document.write('</div>')

 

function MsieMouseFollow(){

 Xpos = document.body.scrollLeft+event.x-5;

 Ypos = document.body.scrollTop+event.y-5;

 }

 document.onmousemove = MsieMouseFollow;

}

else if (document.layers)

{

window.captureEvents(Event.MOUSEMOVE);

for (ns=0; ns < amount; ns++)

document.write("<LAYER NAME='n"+ns+"' LEFT=0 TOP=0><IMG SRC='"+images+"'></LAYER>");

function NsMouseFollow(evnt){

 Xpos = evnt.pageX-5;

 Ypos = evnt.pageY-5;

 }

 window.onMouseMove = NsMouseFollow;

}

function Swirl(){

if (document.all)

{

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

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

}

else if (document.layers)

{

 yBase = window.innerHeight/4;

 xBase = window.innerWidth/4;

}

 

if (document.all)

{

 for (i=0;i<ieDiv.all.c.all.length;i++)

 {

  ieDiv.all.c.all[i].style.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);

  ieDiv.all.c.all[i].style.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);

 }

}

else if (document.layers)

{

 for ( j = 0 ; j < ns ; j++ ) //7 is number of NS layers!

 {

  var temp="n"+j

  document.layers[temp].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);

  document.layers[temp].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);

 }

}

currStep += step;

setTimeout("Swirl()", 10);

}

Swirl();

// -->

</script>

 

0 Comments

Tue

17

Mar

2009

65、鼠标旋转效果4

65、鼠标旋转效果4

脚本说明:

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

<script language="JavaScript">

<!--

Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff')

var speed=1;

var RunTime = 0;

var cntr=0;

var xcntr=100;

var Nslayers;

var pulse=25;

var onClrs;

var Xpos = 421;

var Ypos = 231;

var _y;

if (document.layers){

window.captureEvents(Event.MOUSEMOVE);

function xFollowMouse(evnt){

Xpos = evnt.pageX;

Ypos = evnt.pageY;

}

window.onMouseMove = xFollowMouse;

document.write('<layer name="a0" left=10 top=10 bgcolor="#ff0000" clip="0,0,2,2"></layer>'

+'<layer name="a1" left=10 top=10 bgcolor="#00ff00" clip="0,0,2,2"></layer>'

+'<layer name="a2" left=10 top=10 bgcolor="#ffffff" clip="0,0,2,2"></layer>'

+'<layer name="a3" left=10 top=10 bgcolor="#ffa500" clip="0,0,2,2"></layer>'

+'<layer name="a4" left=10 top=10 bgcolor="#ff00ff" clip="0,0,2,2"></layer>'

+'<layer name="a5" left=10 top=10 bgcolor="#8888ff" clip="0,0,2,2"></layer>'

+'<layer name="a6" left=10 top=10 bgcolor="#fff000" clip="0,0,2,2"></layer>');

}

else if (document.all){

function FollowMouse(){

Xpos = document.body.scrollLeft+event.x;

Ypos = document.body.scrollTop+event.y;

}

document.onmousemove = FollowMouse;

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

+'<div id="c" style="position:relative">'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#ff0000;font-size:2px"></div>'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#00ff00;font-size:2px"></div>'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#ffffff;font-size:2px"></div>'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#ffa500;font-size:2px"></div>'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#ff00ff;font-size:2px"></div>'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#8888ff;font-size:2px"></div>'

+'<div style="position:absolute;top:0px;left:0px;width:2px;height:2px;background:#fff000;font-size:2px"></div>'

+'</div>'

+'</div>');

}

function sv2(){

if (document.layers){

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

{

Nslayers="a"+i;

document.layers[0].top=Ypos+cntr*Math.cos((RunTime+i*4.5)/5);

document.layers[0].left=Xpos+cntr*Math.sin((RunTime+i*4.5)/5);

var randCol=Math.round(Math.random()*8);

document.layers[0].bgColor=Clrs[randCol];

}

cntr+=1;

RunTime+=speed;

stp=setTimeout('sv2()',10);

if (cntr>=100)

{

cntr=100;

speed=2.5;

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

 {

 Nslayers="a"+i;

 document.layers[Nslayers].top=Ypos+cntr*Math.cos((RunTime-100)*i/90);

 document.layers[Nslayers].left=Xpos+cntr*Math.sin((RunTime-100)*i/90);

 }

}

if (RunTime>182)

{

speed=0.5;

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

 {

 Nslayers="a"+i;

 document.layers[Nslayers].top=Ypos+xcntr*Math.cos(((RunTime-182)+i*4.5)/5)*Math.cos((RunTime-182)/5);

 document.layers[Nslayers].left=Xpos+xcntr*Math.sin(((RunTime-182)+i*4.5)/5);

 }

}

}

else if (document.all){

for (i=0;i<ieDiv.all.c.all.length;i++)

{

var randCol=Math.round(Math.random()*8);

ieDiv.all.c.all[0].style.background=Clrs[randCol];

ieDiv.all.c.all[0].style.top=Ypos+cntr*Math.cos((RunTime+i*4.5)/5);

ieDiv.all.c.all[0].style.left=Xpos+cntr*Math.sin((RunTime+i*4.5)/5);

}

cntr+=1;

RunTime+=speed;

window.status=RunTime;

stp=setTimeout('sv2()',10);

if (cntr>=100)

{

cntr=100;

speed=2.5;

for (i=0;i<ieDiv.all.c.all.length;i++)

 {

ieDiv.all.c.all[i].style.top=Ypos+cntr*Math.cos((RunTime-100)*i/90);

ieDiv.all.c.all[i].style.left=Xpos+cntr*Math.sin((RunTime-100)*i/90);

 }

}

if (RunTime>182)

{

speed=0.5;

for (i=0;i<ieDiv.all.c.all.length;i++)

 {

ieDiv.all.c.all[i].style.top=Ypos+xcntr*Math.cos(((RunTime-182)+i*4.5)/5)*Math.cos((RunTime-182)/5);

ieDiv.all.c.all[i].style.left=Xpos+xcntr*Math.sin(((RunTime-182)+i*4.5)/5);

 }

}

}

if (RunTime>210)

{

xcntr-=10;

}

if (document.layers)

_y=-window.innerWidth-90;

else if (document.all)

_y=-document.body.clientWidth-90;

if (xcntr <= _y)

{

RunTime=0;

speed=1;

cntr=0;

xcntr=100;

}

}

sv2()

//-->

</script>

 

0 Comments

Tue

17

Mar

2009

64、鼠标旋转效果3

64、鼠标旋转效果3

脚本说明:

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

<script language="JavaScript">

<!--

//To add more stars simply add more colours in below array!!

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

 

//Alter nothing below!!

amount=colours.length;

YgetDelay=0,XgetDelay=0,Ydelay=0,Xdelay=0,ns=(document.layers)?1:0,step=0.2,currStep=0,my=0,mx=0;

if (ns){

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

document.write('<LAYER NAME="nsstars'+i+'" BGCOLOR='+colours[i]+' CLIP="0,0,2,2"></LAYER>');

}

else{

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

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

document.write('<span id="iestars" style="position:absolute;top:0;left:0;width:2px;height:2px;background:'+colours[i]+';font-size:2px"></span>');

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

}

if (ns){

window.captureEvents(Event.MOUSEMOVE);

function nMouse(evnt){                              

my=evnt.pageY;mx=evnt.pageX

}

window.onMouseMove=nMouse;

}

else{

function iMouse(){

my=event.y;mx=event.x;

}

document.onmousemove=iMouse

}

function stars(){

if (!ns)ie.style.top=document.body.scrollTop;

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

 {

 var layer=(document.layers)?document.layers["nsstars"+i]:iestars[i].style;

 layer.top= Ydelay+100*Math.sin((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10);

 layer.left=Xdelay+180*Math.cos((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10);

 }

currStep+=step;

}

 

function delay(){

Ydelay = YgetDelay+=(my-YgetDelay)*1/20;

Xdelay = XgetDelay+=(mx-XgetDelay)*1/20;

stars();

setTimeout('delay()',10);

}

delay();

//-->

</script>

 

0 Comments

Tue

17

Mar

2009

63、鼠标旋转特效

63、鼠标旋转特效

脚本说明:

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

<script language="JavaScript">

<!-- 

var images='0109arrow.gif';//Put your image name here!!

var amount=7;//Number of images here. Do not alter for this script!!

var cnter=70;

var step;

var currStep = 0;

var Xpos = 0;

var Ypos = 0;

if (document.all)

{

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

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

for (n=0; n < amount; n++)

document.write('<img src=" '+images+'" style="position:absolute;top:0px;left:0px">')

document.write('</div>')

document.write('</div>')

 

function MsieMouseFollow(){

 Xpos = document.body.scrollLeft+event.x-5;

 Ypos = document.body.scrollTop+event.y-5;

 }

 document.onmousemove = MsieMouseFollow;

}

else if (document.layers)

{

window.captureEvents(Event.MOUSEMOVE);

for (ns=0; ns < amount; ns++)

document.write("<LAYER NAME='n"+ns+"' LEFT=0 TOP=0><IMG SRC='"+images+"'></LAYER>");

function NsMouseFollow(evnt){

 Xpos = evnt.pageX-5;

 Ypos = evnt.pageY-5;

 }

 window.onMouseMove = NsMouseFollow;

}

 

function Swirl(){

if (currStep<0.0550)

step=0.001;

if (document.all)

{

 for (i=0;i<ieDiv.all.c.all.length;i++)

 {

ieDiv.all.c.all[i].style.top = Ypos+cnter*Math.cos((currStep+i*4.5)/5)*Math.sin((currStep)*150);

ieDiv.all.c.all[i].style.left = Xpos+cnter*Math.sin((currStep+i*4.5)/5)*Math.sin((currStep)*150);

 }

}

else if (document.layers)

{

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

 {

  var temp="n"+i

  document.layers[temp].top = Ypos+cnter*Math.cos((currStep+i*4.5)/5)*Math.sin((currStep)*150);

  document.layers[temp].left =Xpos+cnter*Math.sin((currStep+i*4.5)/5)*Math.sin((currStep)*150);

 }

}

currStep += step;

setTimeout("Swirl()", 10);

if (currStep>0.0540)

{

step+=0.002;

if (document.layers)

{

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

 {

var temp="n"+i

document.layers[temp].top =Ypos+cnter*Math.cos((currStep+i*4.5)/5)

document.layers[temp].left=Xpos+cnter*Math.sin((currStep+i*4.5)/5)

 }

}

else if (document.all)

{

for (i=0;i<ieDiv.all.c.all.length;i++)

 {

ieDiv.all.c.all[i].style.top=Ypos+cnter*Math.cos((currStep+i*4.5)/5)

ieDiv.all.c.all[i].style.left=Xpos+cnter*Math.sin((currStep+i*4.5)/5)

 }

}

}

if (step > 0.5)

{

step=0.5;

cnter-=8;

}

if (document.layers)

_y=-window.innerWidth;

else if (document.all)

_y=-document.body.clientWidth;

if (cnter <= _y)

{

currStep=0;

step=0.001;

cnter=70;

}

}

Swirl();

// -->

</script>

 

0 Comments

Tue

17

Mar

2009

62、鼠标旋转效果

62、鼠标旋转效果

脚本说明:

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

<script language="JavaScript">

<!-- 

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

Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff')

var amount=8

var step=0.3;

var currStep=0;

var Ypos=0;

var Xpos=0;

if (ns){

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

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

window.captureEvents(Event.MOUSEMOVE); 

function nMouse(evnt){

Ypos = evnt.pageY;

Xpos = evnt.pageX;

}

window.onMouseMove=nMouse;

}

else{

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

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

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

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

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

function iMouse(){

Ypos=event.y+document.body.scrollTop;

Xpos=event.x+document.body.scrollLeft;

}

document.onmousemove = iMouse;

}

function Comet(){

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

var randCol=Math.floor(Math.random()*Clrs.length);

var layer=(document.layers)?document.layers['n'+i]:me[i].style;

layer.top =Ypos+60*Math.sin((currStep + i*3.1)/4)*Math.cos(currStep/10);

layer.left=Xpos+60*Math.cos((currStep + i*3.1)/4);

if (ns) layer.bgColor=Clrs[randCol];else layer.background=Clrs[randCol];

}

currStep+=step;

setTimeout("Comet()",10);

}

window.onload=Comet;

// -->

</script>

 

0 Comments

Sun

08

Mar

2009

61、鼠标旋转文字

61、鼠标旋转文字

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

if (document.all) {

//Things you can alter

yourLogo = "I love JavaScript very much----";  //Not less than 2 letters!

logoFont = "Arial";

logoColor = "00ff00";

//Nothing needs altering below!

yourLogo = yourLogo.split('');

L = yourLogo.length;

TrigSplit = 360 / L;

Sz = new Array()

logoWidth = 100;

logoHeight = -30;

ypos = 0;

xpos = 0;

step = 0.03;

currStep = 0;

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

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

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

+'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;'

+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>');

}

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

function Mouse() {

ypos = event.y;

xpos = event.x - 5;

}

document.onmousemove=Mouse;

function animateLogo() {

outer.style.pixelTop = document.body.scrollTop;

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

ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180);

ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180);

Sz[i] = ie[i].style.pixelTop - ypos;

if (Sz[i] < 5) Sz[i] = 5;

ie[i].style.fontSize = Sz[i] / 1.7;

}

currStep -= step;

setTimeout('animateLogo()', 20);

}

window.onload = animateLogo;

}

//  End -->

</script>

 

0 Comments