Sun

08

Mar

2009

59、鼠标轨迹

59、鼠标轨迹

脚本说明:

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

<style type="text/css">

BODY {overflow: scroll; overflow-x: hidden;}

</style>

<SCRIPT LANGUAGE="JavaScript1.2">

<!-- Begin

var trailLength = 8;     // The length of trail

var path = "cursor1.gif"; // URL to cursor image

 

var isIE = false, isNav = false, range = "all.", style = ".style", i, d = 0;

var topPix = ".pixelTop", leftPix = ".pixelLeft", images, storage;

if (document.layers) {

isNav = true, range = "layers.", style = "", topPix = ".top", leftPix = ".left";

} else if (document.all) {

isIE = true;

}

function initTrail() {

images = new Array();

for (i = 0; i < parseInt(trailLength); i++) {

images[i] = new Image();

images[i].src = path;

}

storage = new Array();

for (i = 0; i < images.length*3; i++) {

storage[i] = 0;

}

for (i = 0; i < images.length; i++) { // make divs for IE and layers for Navigator

(isIE) ? document.write('<div id="obj' + i + '" style="position: absolute; z-Index: 100; height: 0; width: 0"><img src="' + images[i].src + '"></div>') : document.write('<layer name="obj' + i + '" width="0" height="0" z-index="100"><img src="' + images[i].src + '"></layer>');

}

trail();

}

function trail() {

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

eval("document." + range + "obj" + i + style + topPix + "=" + storage[d]);

eval("document." + range + "obj" + i + style + leftPix + "=" + storage[d+1]);

d = d+2;

}

for (i = storage.length; i >= 2; i--) {;

storage[i] = storage[i-2];

}

d = 0;

clearTimeout(timer);

var timer = setTimeout("trail()", 10);

}

function processEvent(e) {

if (isIE) {

storage[0] = window.event.y+document.body.scrollTop+10;

storage[1] = window.event.x+document.body.scrollLeft+10;

} else {

storage[0] = e.pageY+12;

storage[1] = e.pageX+12;

   }

}

if (isNav) {

document.captureEvents(Event.MOUSEMOVE);

}

if (isIE || isNav) {

initTrail();

document.onmousemove = processEvent;

}

//  End -->

</script>

 

 

 

0 Comments

Sun

08

Mar

2009

58、鼠标旋转效果

58、鼠标旋转效果

脚本说明:

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

<script language="JavaScript">

<!--

var CoLoUrS=new Array('ff0000','ffffff','0000ff','ffffff');//<--Add own/more colours here!

var dots=16;

var ThingsInArray;

var step=0.3;

var a_StEp=0.05;

var RunTime=0;

var currStep = 0;

var Xpos = 0;

var Ypos = 0;

var cntr=70;

var count_a=0;

var move_a=1;

var curColour;

var count=0;

var move=1;

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

if (brwsr){

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

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

}

var x = document;

ThingsInArray=new Array(x.a0,x.a1,x.a2,x.a3,x.a4,x.a5,x.a6,x.a7,x.a8,x.a9,x.a10,x.a11,x.a12,x.a13,x.a14,x.a15)

}

else{

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

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

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

}

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

var x = ieDiv.all.c.all;

ThingsInArray=new Array(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15])

}

 

function colourStep(){

count+=move;

if (count >= ThingsInArray.length) {count=0;count_a+=move}

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

if (brwsr) ThingsInArray[count].bgColor=CoLoUrS[count_a];

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

setTimeout('colourStep()',100)

}

function moveAbout(){

if (brwsr){

Ypos = window.pageYOffset+window.innerHeight/2 + window.innerHeight/3.1 * Math.cos((RunTime)/3)*Math.cos(RunTime/50);

Xpos = window.pageXOffset+window.innerWidth/2 + window.innerWidth/2.4 * Math.sin((RunTime)/5)*Math.cos(RunTime/30);

}

else{

Ypos = document.body.scrollTop+document.body.offsetHeight/2 + document.body.offsetHeight/2.8*Math.cos((RunTime)/3)*Math.cos(RunTime/10);

Xpos=  document.body.scrollLeft+document.body.offsetWidth/2 + document.body.offsetWidth/2.4*Math.sin((RunTime)/5)*Math.sin(RunTime/20);

 }

RunTime+=a_StEp;

Tma=setTimeout("moveAbout()", 10);

}

 

function TwistnSpin(){

if (brwsr){

 for ( i = 0 ; i < 16 ; i++ ) //number of NS layers!

 {

  var templayer="a"+i

  document.layers[templayer].top = Ypos+cntr*Math.cos((currStep + i*4)/10.2)*Math.cos(currStep/10)

  document.layers[templayer].left =Xpos+cntr*Math.sin((currStep + i*4)/10.2);

 }

}

else{

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

 {                                         

 ieDiv.all.c.all[i].style.top = Ypos+cntr*Math.cos((currStep + i*4)/10.2)*Math.cos(currStep/10)

 ieDiv.all.c.all[i].style.left= Xpos+cntr*Math.sin((currStep + i*4)/10.2);

 }

}

currStep+=step;

setTimeout("TwistnSpin()",10);

}

function Shrink(){

cntr-=0.5;

GoShrink=setTimeout('Shrink()',10);

if (cntr <=20)

{clearTimeout(GoShrink);Swell()}

}

function Swell(){

cntr+=0.5;

GoSwell=setTimeout('Swell()',10);

if (cntr >=70)

{clearTimeout(GoSwell);Shrink()}

}

function StArTuP(){

moveAbout();

TwistnSpin();

Shrink();

colourStep();

}

StArTuP();

// -->

</script>

 

1 Comments

Sun

08

Mar

2009

57、三色鼠标效果

57、三色鼠标效果

脚本说明:

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

<script language="JavaScript">

<!--

//Choose colours and size of effect !!

var a_Colour='fff000';

var b_Colour='00ff00';

var c_Colour='ff00ff';

var Size=120;

//Alter nothing below !!

 

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

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.sin((1*Math.sin((ThisStep)/10))+i*2)*Math.sin((ThisStep)/4);

 XDummy[i]=xpos+Size*Math.cos((1*Math.sin((ThisStep)/10))+i*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

Sun

08

Mar

2009

56、鼠标旋转效果

56、鼠标旋转效果

脚本说明:

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

<LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,2,2"></LAYER>

<LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF8000" CLIP="0,0,2,2"></LAYER>

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

<LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00FF00" CLIP="0,0,2,2"></LAYER>

<LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#0000FF" CLIP="0,0,2,2"></LAYER>

<LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF00FF" CLIP="0,0,2,2"></LAYER>

<LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FFFFFF" 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;visibility:visible"></div>

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

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

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

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

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

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

</div>

 

<script language="JavaScript">

<!--  Script adapted for Explorer by kurt.grigg@virgin.net

if (document.layers)

{window.captureEvents(Event.MOUSEMOVE);}

var yBase = 200;

var xBase = 200;

var step = .2;

var currStep = 0;

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)

{

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

 {

  starsDiv.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);

  starsDiv.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 < 7 ; j++ ) //7 is number of NS layers!

 {

  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()", 10);

}

animateLogo();

// -->

</script>

 

0 Comments

Sun

08

Mar

2009

55、状态栏读页面字符

55、状态栏读页面字符

脚本说明:

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

<SCRIPT language=JavaScript>

function doMouseMove() {

var tr = document.body.createTextRange();

tr.moveToPoint(event.clientX, event.clientY);

 // Expand to the entire word under the mouse.

tr.expand("word");

window.status = tr.text;

 }

 document.onmousemove = doMouseMove;

</SCRIPT>

<P align=center>

中国队泰王杯首场比赛和卡塔尔队打平后,也许没有哪一场比赛令米卢这样无奈,<BR>也许没有哪一天让他如此伤心,在我们的记忆中,第一次看到米卢摊开双手,<BR>第一次看到米卢摊开双手,耸动着双肩几次欲言又止。<BR>次战瑞典对于中国队此次泰国之行是决定性的,米卢的声誉也由这一战的<BR>..成绩而左右。中国队对瑞典队的首发阵容是:前锋:张玉宁、曲波。中场:邵..<BR>佳一、李铁、祁宏、李明。后卫:吴承瑛、李玮峰、舒畅、陈刚。守门员:江<BR>开赛后,中国队的进攻比较积极。第4分钟,瑞典队19号禁区前一脚劲</P>

 

0 Comments

Sun

08

Mar

2009

54、图片的十字瞄准线

54、图片的十字瞄准线

脚本说明:

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

<STYLE type=text/css>.hair {

       BACKGROUND-COLOR: red; FONT-SIZE: 1px; HEIGHT: 1px; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 1px; layer-background-color: red

}

</STYLE>

<DIV class=hair id=xhair></DIV>

<DIV class=hair id=yhair></DIV>

<DIV id=target

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

border=0 height=32 src="boy5c.gif" width=32> </DIV>

<SCRIPT language=javascript>

var isNS=(navigator.appName=="Netscape");

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

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

var _visible=(isNS)? 'show' : 'visible';

 

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

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

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

 

function resize(){

if(isNS){

xhair.clip.width=window.innerWidth;

xhair.clip.height=1;

yhair.clip.width=1;

yhair.clip.height=window.innerHeight;

}else{

xhair.width=document.body.clientWidth;

yhair.height=document.body.clientHeight;

}}

 

function movehair(evnt){

if(isNS){

xhair.moveTo(pageXOffset,evnt.pageY);

yhair.moveTo(evnt.pageX,pageYOffset);

target.moveTo(evnt.pageX-20,evnt.pageY-20);

}else{

xhair.pixelTop=event.clientY+document.body.scrollTop;

xhair.pixelLeft=document.body.scrollLeft;

yhair.pixelLeft=event.clientX+document.body.scrollLeft;

yhair.pixelTop=document.body.scrollTop;

target.pixelTop=event.clientY+document.body.scrollTop-20;

target.pixelLeft=event.clientX+document.body.scrollLeft-20;

}

return false;

}

 

function reloadNS(){

setTimeout('window.location.reload()', 500);

}

 

(isNS)? window.onresize=reloadNS : window.onresize=resize;

 

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

document.onmousemove=movehair;

 

window.onload=resize;

 

</SCRIPT>

 

0 Comments

Sun

08

Mar

2009

53、图片旋转效果

53、图片旋转效果

脚本说明:

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

<script language="JavaScript">

<!--

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

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

var speed=1;

var RunTime = 0;

var cntr=0;

var xcntr=100;

var pulse=25;

var Xpos = 0;

var Ypos = 0;

var _y;

var temp;

 

/*If you use an image larger or smaller than the one I've used

the cursor will be off center.Alter the 2 variables below to center it.*/

var UpDown=-10;

var LeftRight=-5;

 

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;visibility:hidden">');

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

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

 

function FollowMouse(){

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

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

}

document.onmousemove = FollowMouse;

}

 

else if (document.layers){

window.captureEvents(Event.MOUSEMOVE);

function xFollowMouse(evnt){

Xpos = evnt.pageX+UpDown;

Ypos = evnt.pageY+LeftRight;

}

window.onMouseMove = xFollowMouse;

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

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

}

 

 

function msi(){

if (document.layers){

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

{

temp="n"+i

document.layers[0].visibility='show';

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);

}

cntr+=1;

RunTime+=speed;

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

if (cntr>=100)

{

cntr=100;

speed=2.5;

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

{

 temp="n"+i

 document.layers[temp].visibility='show';

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

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

 }

}

if (RunTime>182)

{

speed=0.5;

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

{

 temp="n"+i

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

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

 }

}

}

 

 

 

else if (document.all){

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

{

ieDiv.all.c.all[0].style.visibility='visible';

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;

stp=setTimeout('msi()',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.visibility='visible';

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);

ieDiv.all.c.all[i].style.left=Xpos+xcntr*Math.sin(((RunTime-182)+i*4.5)/5)*Math.cos((RunTime-182)/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;

}

}

msi()

//-->

</script>

 

0 Comments

Sun

08

Mar

2009

52、鼠标旋转效果

52、鼠标旋转效果

脚本说明:

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

<script language="JavaScript">

<!-- 

var speed;

var RunTime = 0;

var Xpos = 0;

var Ypos = 0;

var pulse=25;

var cnter=70;

var _y;

if (document.layers)

{

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="#FF8000" CLIP="0,0,2,2"></LAYER>'

+'<LAYER NAME="a2" LEFT=10 TOP=10 BGCOLOR="#FFFF00" CLIP="0,0,2,2"></LAYER>'

+'<LAYER NAME="a3" LEFT=10 TOP=10 BGCOLOR="#00FF00" CLIP="0,0,2,2"></LAYER>'

+'<LAYER NAME="a4" LEFT=10 TOP=10 BGCOLOR="#0000FF" CLIP="0,0,2,2"></LAYER>'

+'<LAYER NAME="a5" LEFT=10 TOP=10 BGCOLOR="#FF00FF" CLIP="0,0,2,2"></LAYER>'

+'<LAYER NAME="a6" LEFT=10 TOP=10 BGCOLOR="#FFFFFF" CLIP="0,0,2,2"></LAYER>');

window.captureEvents(Event.MOUSEMOVE);

function xMoveHandler(evnt){

 Xpos = evnt.pageX;

 Ypos = evnt.pageY;

 }

 window.onMouseMove = xMoveHandler;

}

else if (document.all)

{

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 MoveHandler(){

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

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

}

document.onmousemove = MoveHandler;

}

function sv3(){

if (RunTime<0.0550)

speed=0.001;

 

if (document.layers)

{

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

 {

var ntscp="a"+i

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

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

 }

}

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((RunTime+i*4.5)/5)*Math.sin((RunTime)*150);

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

 }

}

RunTime+=speed;

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

if (RunTime>0.0540)

{

speed+=0.002;

if (document.layers)

{

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

 {

var ntscp="a"+i

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

document.layers[ntscp].left=Xpos+cnter*Math.sin((RunTime+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((RunTime+i*4.5)/5)

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

 }

}

}

if (speed > 0.5)

{

speed=0.5;

cnter-=8;

}

if (document.layers)

_y=-window.innerHeight;

else if (document.all)

_y=-document.body.clientHeight;

if (cnter <= _y)

{

RunTime=0;

speed=0.001;

cnter=70;

}

}

sv3();

//-->

</script>

 

0 Comments

Sun

08

Mar

2009

51、跟随鼠标的气泡效果

51、跟随鼠标的气泡效果

1 Comments

Sun

08

Mar

2009

50、跟随鼠标的旋转文字

50、跟随鼠标的旋转文字

<SCRIPT LANGUAGE="JavaScript">

if (document.all) {

yourLogo = "跟随鼠标的旋转文字 ";

logoFont = "宋体";

logoColor = "000000";

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;

}

</script>

 

 

0 Comments

Sun

08

Mar

2009

49、鼠标放到相应在图片上就可以实现页面的上下移动

49、鼠标放到相应在图片上就可以实现页面的上下移动

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

 

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

 

<SCRIPT LANGUAGE="JavaScript">

 

 

 

 

 

<!-- Begin

 

var isNS=(document.layers);

 

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

 

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

 

var _visible=(isNS)? 'show' : 'visible';

 

var w_x, w_y, item, okscroll=false, godown;

 

function init(){

 

item=eval('document.'+_all+'item'+_style);

 

getwindowsize();

 

item.visibility=_visible;

 

scrollpage();

 

}

 

function getwindowsize() {

 

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

 

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

 

(isNS)? item.clip.width=42: item.width=42;

 

(isNS)? item.clip.height=20 : item.height=20;

 

moveitem();

 

}

 

function resizeNS() {

 

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

 

}

 

function moveitem() {

 

if (isNS) {

 

item.moveTo((pageXOffset+w_x-70),(w_y+pageYOffset-50))

 

}else{

 

item.pixelLeft=document.body.scrollLeft+w_x-70;

 

item.pixelTop=w_y+document.body.scrollTop-50;

 

   }

 

}

 

window.onload=init;

 

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

 

function scrollpage() {

 

status = '';

 

if (okscroll) {

 

if (godown) {

 

(isNS)? window.scrollBy(0,4) : window.scrollBy(0,4) ;

 

} else {

 

(isNS)? window.scrollBy(0,-4) : window.scrollBy(0,-4) ;

 

   }

 

}

 

moveitem();

 

setTimeout('scrollpage()', 40);

 

}

 

//  End -->

 

</script>

 

 

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

 

<div id="item">

 

<a href="javascript:void(0)" onMouseover="okscroll=true; godown=true"

 

onMouseout="okscroll=false"><img src="gt.gif" border="0" alt="向上"></a><a

 

href="javascript:void(0)"

 

onMouseover="okscroll=true; godown=false" onMouseout="okscroll=false"><img src="lt.gif"

 

border="0" alt="向下"></a>

 

</div>

 

 

0 Comments

Sun

08

Mar

2009

48、不错的鼠标特效效果

48、不错的鼠标特效效果

<STYLE type="text/css">

BODY{

background-attachment:fixed;

background-image:url('images/1.jpg');

background-repeat:no-repeat;

background-color:'black';

background-position:center 50%

}

</style>

<SCRIPT LANGUAGE="JavaScript">

var images='images/1602.gif';

var amount=7;

var speed=1;

var RunTime = 0;

var cntr=0;

var xcntr=100;

var pulse=25;

var Xpos = 0;

var Ypos = 0;

var _y;

var temp;

 

 

var UpDown=-10;

var LeftRight=-5;

 

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;visibility:hidden">');

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

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

 

function FollowMouse(){

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

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

}

document.onmousemove = FollowMouse;

}

 

else if (document.layers){

window.captureEvents(Event.MOUSEMOVE);

function xFollowMouse(evnt){

Xpos = evnt.pageX+UpDown;

Ypos = evnt.pageY+LeftRight;

}

window.onMouseMove = xFollowMouse;

for (ns=0; ns < amount; ns++) document.write("<LAYER NAME='ie"+ie+"' LEFT=0 TOP=0 VISIBILITY=HIDE><IMG SRC='"+images+"'></LAYER>");

}

 

 

function msi(){

if (document.layers){

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

{

temp="n"+i

document.layers[0].visibility='show';

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);

}

cntr+=1;

RunTime+=speed;

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

if (cntr>=100)

{

cntr=100;

speed=2.5;

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

{

temp="n"+i

document.layers[temp].visibility='show';

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

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

}

}

if (RunTime>182)

{

speed=0.5;

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

{

temp="n"+i

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

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

}

}

}

 

 

 

else if (document.all){

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

{

ieDiv.all.c.all[0].style.visibility='visible';

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;

stp=setTimeout('msi()',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.visibility='visible';

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);

ieDiv.all.c.all[i].style.left=Xpos+xcntr*Math.sin(((RunTime-182)+i*4.5)/5)*Math.cos((RunTime-182)/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;

}

}

msi()

//-->

</script>

 

 

0 Comments

Sun

08

Mar

2009

47、鼠标经过文字变色

47、鼠标经过文字变色

脚本说明:

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

<p onMouseMove="hello()">鼠标经过时就会变色的文本</p>

                  <script language="VBScript">

sub hello

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

end sub

</script>

 

 

0 Comments

Sun

08

Mar

2009

46、鼠标控制窗口开关

46、鼠标控制窗口开关

脚本说明:

第一步:把如下代码加入<head>区域中(你可以对链接及说明作相应修改)

<SCRIPT Language="JavaScript">function winopen() {msg1=open("update.htm","Homepage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250");}</script>

 

 

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

<SCRIPT Language="JavaScript">function winopen1() {msg1=open("sh3.htm","Homepage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=250");}</script>

<a href="#" onMouseOver="winopen1(); return true;" onMouseOut="msg1.close();">update</a>

 

 

0 Comments

Sun

08

Mar

2009

45、鼠标旋转效果

45、鼠标旋转效果

脚本说明:

把如下代码加入<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

Sun

08

Mar

2009

44、攻击鼠标的文字

44、攻击鼠标的文字

步骤一: 请将下面的原代码插入到<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

Sun

08

Mar

2009

43、文字从右向左移动,鼠标移上去停止

43、文字从右向左移动,鼠标移上去停止

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

 

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

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var ostat = false;

function scrollstop() {

news.scrollAmount = 0;

ostat = true;

}

function scrollplay() {

news.scrollAmount = 5;

ostat = false;

}

function scrolldir() {

mid = screen.width / 2;

mouse = event.x;

if(mouse > mid) {

if(ostat == false) {

speed = (mouse - mid) / 25;

news.scrollAmount = speed;

}

news.direction = "right";

}

else {

if(ostat == false) {

speed = (mid - mouse) / 25;

news.scrollAmount = speed;

}

news.direction = "left";

   }

}

//  End -->

</script>

 

 

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

 

<marquee name=news id=news behavior=scroll direction=left scrollamount=5 scrolldelay=1 hspace=0 vspace=0 onmouseover="scrollstop()" onmouseout="scrollplay()">

<b>Welcome To Typhoon Start JavaScript Fairyland!</b>

</marquee>

 

 

第三步:把“onMouseMove="scrolldir()"”加在标记里

例如:

 

 

0 Comments

Sun

08

Mar

2009

42、让你见见各种形态的鼠标

42、让你见见各种形态的鼠标

要完成此效果把如下代码加入到<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

Sun

08

Mar

2009

41、跟随鼠标的彩色闪烁文字

41、跟随鼠标的彩色闪烁文字

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

 

第一步:把如下代码加入到<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=" !";

    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>

 

 

第三步:把“onload=javascript:pageonload()”加在<body>标记里

例如:<body onload=javascript:pageonload()>

 

 

0 Comments

Sun

08

Mar

2009

40、跟着鼠标旋转的鼠标代码

40、跟着鼠标旋转的鼠标代码

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

 

<script language="JavaScript">

<!-- 

var images='images/1602.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

Sun

08

Mar

2009

39、将鼠标按字上移动鼠标

39、将鼠标按字上移动鼠标

<style>

.drag{position:relative;cursor:hand}

</style>

<script language="JavaScript">

var dragapproved=false

var z,x,y

function move(){

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

z.style.pixelLeft=temp1+event.clientX-x

z.style.pixelTop=temp2+event.clientY-y

return false}}

function drags(){

if (!document.all)

return

if (event.srcElement.className=="drag"){

dragapproved=true

z=event.srcElement

temp1=z.style.pixelLeft

temp2=z.style.pixelTop

x=event.clientX

y=event.clientY

document.onmousemove=move}}

document.onmousedown=drags

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

</script>

<span style="font-family:幼圆;font-size: 9pt"><font color=#000000 class="drag">将鼠标按在这些字上移动鼠标试试看!啦啦啦</font></span>

 

<style>

.drag{position:relative;cursor:hand}

</style>

<script language="JavaScript">

var dragapproved=false

var z,x,y

function move(){

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

z.style.pixelLeft=temp1+event.clientX-x

z.style.pixelTop=temp2+event.clientY-y

return false}}

function drags(){

if (!document.all)

return

if (event.srcElement.className=="drag"){

dragapproved=true

z=event.srcElement

temp1=z.style.pixelLeft

temp2=z.style.pixelTop

x=event.clientX

y=event.clientY

document.onmousemove=move}}

document.onmousedown=drags

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

</script>

<span style="font-family:幼圆;font-size: 9pt"><font color=#000000 class="drag">将鼠标按在这些字上移动鼠标试试看!啦啦啦</font></span>

 

0 Comments

Sun

08

Mar

2009

38、蚂蚁上树鼠标代码

38、蚂蚁上树鼠标代码

<html>

<head>

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

 

<title>网页特效---爬向鼠标的好多蚂蚁</title>

</head>

 

<body>

 

 

<style type="text/css">

.ant {

  height: 16px;

  position: absolute;

  visibility: hidden;

  width: 16px;

}

</style>

<SCRIPT LANGUAGE="JavaScript">

var dir = "images/";

var images = new Array(

dir+"antdl.gif",

dir+"antdn.gif",

dir+"antdr.gif",

dir+"antlt.gif",

dir+"antrt.gif",

dir+"antul.gif",

dir+"antup.gif",

dir+"antur.gif"

);

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

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

var _LBimgList;

var _LBimgCount;

var _LBbase = "LBbase";

var _LBlow  = "LBlow";

var _LBhigh = "LBhigh";

var _LBwidth;

var _LBheight;

var _LBbaseLayer;

var _LBlowLayer;

var _LBhighLayer;

function createLoadBar(width, height, bdSize, bdColor, bgColor, fgColor, fontFace, fontSize, text) {

var txtLow, txtHigh, tblStart, tblEnd;

var str;

txtLow  = '<font color="' + fgColor + '" face="' + fontFace + '" size=' + fontSize + '>' + text + '</font>';

txtHigh = '<font color="' + bgColor  + '" face="' + fontFace + '" size=' + fontSize + '>' + text + '</font>';

tblStart = '<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%><tr valign="center"><td align="center">';

tblEnd = '</td></tr></table>';

if (isMinNS4)

str = '<layer name="' + _LBbase + '" bgcolor="' + bdColor + '" width=' + width + ' height=' + height + ' visibility="hide">\n'

+ '  <layer name="' + _LBlow  + '" bgcolor="' + bgColor + '" left=' + bdSize + ' top=' + bdSize + ' width=' + (width - 2 * bdSize) + ' height=' + (height - 2 * bdSize) + '>' + tblStart + txtLow + tblEnd + '</layer>\n'

+ '  <layer name="' + _LBhigh + '" bgcolor="' + fgColor + '" left=' + bdSize + ' top=' + bdSize + ' width=' + (width - 2 * bdSize) + ' height=' + (height - 2 * bdSize) + '>' + tblStart + txtHigh + tblEnd + '</layer>\n'

+ '</layer>';

if (isMinIE4)

str = '<div id="' + _LBbase + '" style="position:absolute; background-color:' + bdColor + '; width:' + width + 'px; height:' + height + 'px; visibility:hidden;">\n'

+ '  <div id="' + _LBlow  + '" style="position:absolute; background-color=' + bgColor + '; left:' + bdSize + 'px; top:' + bdSize + 'px; width:' + (width - 2 * bdSize) + 'px; height:' + (height - 2 * bdSize) + 'px;">' + tblStart + txtLow + tblEnd + '</div>\n'

+ '  <div id="' + _LBhigh  + '" style="position:absolute; background-color=' + fgColor + '; left:' + bdSize + 'px; top:' + bdSize + 'px; width:' + (width - 2 * bdSize) + 'px; height:' + (height - 2 * bdSize) + 'px;">' + tblStart + txtHigh + tblEnd + '</div>\n'

+ '</div>';

document.writeln(str);

_LBwidth = width - 2 * bdSize;

_LBheight = height - 2 * bdSize;

}

function startLoadBar(srcList, x, y) {

var i, w, h;

if (isMinNS4) {

_LBbaseLayer = document.layers[_LBbase];

_LBlowLayer  = _LBbaseLayer.document.layers[_LBlow];

_LBhighLayer = _LBbaseLayer.document.layers[_LBhigh];

}

if (isMinIE4) {

_LBbaseLayer = eval('document.all.' + _LBbase);

_LBlowLayer  = eval('document.all.' + _LBlow);

_LBhighLayer = eval('document.all.' + _LBhigh);

}

if (isMinNS4) {

w = window.innerWidth;

h = window.innerHeight;

}

if (isMinIE4) {

w = document.body.clientWidth;

h = document.body.clientHeight;

}

if (x == null)

x = Math.round((w  - _LBwidth)  / 2);

if (y == null)

y = Math.round((h - _LBheight) / 2);

moveLayerTo(_LBbaseLayer, x, y);

clipLayer(_LBhighLayer, 0, 0, 0, _LBheight);

showLayer(_LBbaseLayer);

_LBimgCount = 0;

_LBimgList = new Array();

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

_LBimgList[i] = new Image();

_LBimgList[i].onabort = _LBupdate;

_LBimgList[i].onerror = _LBupdate;

_LBimgList[i].onload  = _LBupdate;

}

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

_LBimgList[i].src = srcList[i];

}

function endLoadBar() {

}

function _LBupdate() {

var pct;

_LBimgCount++;

pct = _LBimgCount / _LBimgList.length;

clipLayer(_LBhighLayer, 0, 0, Math.round(pct * _LBwidth), _LBheight);

if (_LBimgCount == _LBimgList.length) {

setTimeout('hideLayer(_LBbaseLayer)', 500);

endLoadBar();

}

}

function moveLayerTo(layer, x, y) {

if (isMinNS4)

layer.moveTo(x, y);

if (isMinIE4) {

layer.style.left = x;

layer.style.top  = y;

}

}

function hideLayer(layer) {

if (isMinNS4)

layer.visibility = "hide";

if (isMinIE4)

layer.style.visibility = "hidden";

}

function getWindowWidth() {

if (isMinNS4)

return(window.innerWidth);

if (isMinIE4)

return(document.body.offsetWidth);

return(-1);

}

function getWindowHeight() {

if (isMinNS4)

return(window.innerHeight);

if (isMinIE4)

return(document.body.offsetHeight);

return(-1);

}

function getPageScrollX() {

if (isMinNS4)

return(window.pageXOffset);

if (isMinIE4)

return(document.body.scrollLeft);

return(-1);

}

function getPageScrollY() {

if (isMinNS4)

return(window.pageYOffset);

if (isMinIE4)

return(document.body.scrollTop);

return(-1);

}

function getHeight(layer) {

if (isMinNS4) {

if (layer.document.height)

return(layer.document.height);

else

return(layer.clip.bottom - layer.clip.top);

}

if (isMinIE4) {

if (false && layer.style.pixelHeight)

return(layer.style.pixelHeight);

else

return(layer.clientHeight);

}

return(-1);

}

function getWidth(layer) {

if (isMinNS4) {

if (layer.document.width)

return(layer.document.width);

else

return(layer.clip.right - layer.clip.left);

}

if (isMinIE4) {

if (layer.style.pixelWidth)

return(layer.style.pixelWidth);

else

return(layer.clientWidth);

}

return(-1);

}

function getLeft(layer) {

if (isMinNS4)

return(layer.left);

if (isMinIE4)

return(layer.style.pixelLeft);

return(-1);

}

function getTop(layer) {

if (isMinNS4)

return(layer.top);

if (isMinIE4)

return(layer.style.pixelTop);

return(-1);

}

function getRight(layer) {

if (isMinNS4)

return(layer.left + getWidth(layer));

if (isMinIE4)

return(layer.style.pixelLeft + getWidth(layer));

return(-1);

}

function getBottom(layer) {

if (isMinNS4)

return(layer.top + getHeight(layer));

else if (isMinIE4)

return(layer.style.pixelTop + getHeight(layer));

return(-1);

}

function moveLayerBy(layer, dx, dy) {

if (isMinNS4)

layer.moveBy(dx, dy);

if (isMinIE4) {

layer.style.pixelLeft += dx;

layer.style.pixelTop+= dy;

}

}

function showLayer(layer) {

if (isMinNS4)

layer.visibility = "show";

if (isMinIE4)

layer.style.visibility = "visible";

}

function clipLayer(layer, clipleft, cliptop, clipright, clipbottom) {

if (isMinNS4) {

layer.clip.left = clipleft;

layer.clip.top= cliptop;

layer.clip.right= clipright;

layer.clip.bottom = clipbottom;

}

if (isMinIE4)

layer.style.clip = 'rect(' + cliptop + ' ' +clipright + ' ' + clipbottom + ' ' + clipleft +')';

}

var mouseX = 0;

var mouseY = 0;

if (isMinNS4)

document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = getMousePosition;

function init() {

startLoadBar(images);

}

function getMousePosition(e) {

if (isMinNS4) {

mouseX = e.pageX;

mouseY = e.pageY;

}

if (isMinIE4) {

mouseX = event.clientX + document.body.scrollLeft;

mouseY = event.clientY + document.body.scrollTop;

}

return true;

}

var ants = new Array(8);

function endLoadBar() {

var i;

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

if (isMinNS4) {

ants[i] = document.layers["ant" + (i + 1)];

ants[i].image = ants[i].document.images["antimg" + (i + 1)];

}

if (isMinIE4) {

ants[i] = eval('document.all.ant' + (i + 1));

ants[i].image = document.images["antimg" + (i + 1)];

}

initAnt(i);

showLayer(ants[i]);

}

updateAnts();

}

function initAnt(n) {

var s, x, y;

x = Math.floor(Math.random() * getWindowWidth());

y = Math.floor(Math.random() * getWindowHeight());

s = Math.floor(Math.random() * 4);

if (s == 0)

x = -getWidth(ants[n]);

if (s == 1)

x = getWindowWidth();

if (s == 2)

y = -getHeight(ants[n]);

if (s == 3)

y = getWindowHeight();

x += getPageScrollX();

y += getPageScrollY();

moveLayerTo(ants[n], x, y);

}

function updateAnts() {

var i, dx, dy, theta, d;

d = 3;

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

dx = mouseX - getLeft(ants[i]);

dy = mouseY - getTop(ants[i]);

theta = Math.round(Math.atan2(-dy, dx) * 180 / Math.PI);

if (theta < 0)

theta += 360;

if (Math.abs(dx) < d && Math.abs(dy) < d)

initAnt(i);

else if (theta > 22.5 && theta <= 67.5) {

moveLayerBy(ants[i], d, -d);

ants[i].image.src = dir+"antur.gif";

}

else if (theta > 67.5 && theta <= 112.5) {

moveLayerBy(ants[i], 0, -d);

ants[i].image.src = dir+"antup.gif";

}

else if (theta > 112.5 && theta <= 157.5) {

moveLayerBy(ants[i], -d, -d);

ants[i].image.src = dir+"antul.gif";

}

else if (theta > 157.5 && theta <= 202.5) {

moveLayerBy(ants[i], -d, 0);

ants[i].image.src = dir+"antlt.gif";

}

else if (theta > 202.5 && theta <= 247.5) {

moveLayerBy(ants[i], -d, d);

ants[i].image.src = dir+"antdl.gif";

}

else if (theta > 247.5 && theta <= 292.5) {

moveLayerBy(ants[i], 0, d);

ants[i].image.src = dir+"antdn.gif";

}

else if (theta > 292.5 && theta <= 337.5) {

moveLayerBy(ants[i], d, d);

ants[i].image.src = dir+"antdr.gif";

}

else {

moveLayerBy(ants[i], d, 0);

ants[i].image.src = dir+"antrt.gif";

}

}

setTimeout('updateAnts()', 50);

return;

}

</script>

<body OnLoad="init()">

<script language="JavaScript">

createLoadBar(240, 20, 1, "#000000", "#cccccc", "#999999", "MS Sans serif,Arial,Helvetica", 1, "<b>Loading ants, please wait...</b>");

</script>

<div id="ant1" class="ant"><img name="antimg1" src="transparent.gif" width=13 height=13></div>

<div id="ant2" class="ant"><img name="antimg2" src="transparent.gif" width=13 height=13></div>

<div id="ant3" class="ant"><img name="antimg3" src="transparent.gif" width=13 height=13></div>

<div id="ant4" class="ant"><img name="antimg4" src="transparent.gif" width=13 height=13></div>

<div id="ant5" class="ant"><img name="antimg5" src="transparent.gif" width=13 height=13></div>

<div id="ant6" class="ant"><img name="antimg6" src="transparent.gif" width=13 height=13></div>

<div id="ant7" class="ant"><img name="antimg7" src="transparent.gif" width=13 height=13></div>

<div id="ant8" class="ant"><img name="antimg8" src="transparent.gif" width=13 height=13></div>

 

</body>

 

</html>

 

0 Comments

Sun

08

Mar

2009

37、跟随鼠标的棉花糖

37、跟随鼠标的棉花糖

<HTML><HEAD><TITLE>网页特效---跟随鼠标的棉花糖</TITLE>

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

<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){

ob.select();js=ob.createTextRange();js.execCommand("Copy");

}

//-->

</SCRIPT>

 

<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>

<BODY bgColor=#000000 id=all text=#FFFFFF><LAYER CLIP="0,0,3,3"

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a0"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a1"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a2"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a4"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a5"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a6"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a8"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a9"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a10"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a12"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a13"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a14"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a16"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a17"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a18"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a20"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a21"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a22"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a24"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a25"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a26"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a28"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a29"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

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

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a32"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a33"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a34"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a36"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a37"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a38"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a40"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a41"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a42"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF"

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

BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10" NAME="a44"></LAYER><LAYER

CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW" TOP="10" LEFT="10"

NAME="a45"></LAYER><LAYER CLIP="0,0,3,3" BGCOLOR="#FFFFFF" VISIBILITY="SHOW"

TOP="10" LEFT="10" NAME="a46"></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:#FFFFFF;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>

 

</BODY></HTML>

 

0 Comments

Sun

08

Mar

2009

36、跟随鼠标的另类文字

36、跟随鼠标的另类文字

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

 

<script language="JavaScript1.2">

var scroller_msg='网页特效代码欢迎你7stk.com'

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

Sun

08

Mar

2009

35、鼠标跟踪器代码

35、鼠标跟踪器代码

脚本说明:

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

<SCRIPT language="JavaScript">

<!--

B=document.all;

C=document.layers;

T1=new Array("trail1.gif",38,35,"trail2.gif",30,31,"trail3.gif",28,26,"trail4.gif",22,21,"trail5.gif",16,16)

nos=parseInt(T1.length/3)

rate=50

ie5fix1=0;

ie5fix2=0;

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

createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+T1[i*3]+"' width="+T1[(i*3+1)]+" height="+T1[(i*3+2)]+" border=0>")}

function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){

with (document){

write((!B) ? "<layer id='"+N+"' left="+Xp+" top="+Yp+" width="+W+" height="+H : "<div id='"+N+"'"+" style='position:absolute;left:"+Xp+"; top:"+Yp+"; width:"+W+"; height:"+H+"; ");

if(St){

if (C)

write(" style='");

write(St+";' ")

}

else write((B)?"'":"");

write((At)? At+">" : ">");

write((HT) ? HT : "");

if (!Op)

closeContainer(N)

}

}

function closeContainer(){

document.write((B)?"</div>":"</layer>")

}

function getXpos(N){

return (B) ? parseInt(B[N].style.left) : C[N].left

}

function getYpos(N){

return (B) ? parseInt(B[N].style.top) : C[N].top

}

 

function moveContainer(N,DX,DY){

c=(B) ? B[N].style :C[N];c.left=DX;c.top=DY

}

function cycle(){

//if (IE5)

if (document.all&&window.print){

ie5fix1=document.body.scrollLeft;

ie5fix2=document.body.scrollTop;

}

for (i=0;i<(nos-1);i++){

moveContainer("CUR"+i,getXpos("CUR"+(i+1)),getYpos("CUR"+(i+1)))

}

}

function newPos(e){

moveContainer("CUR"+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2

)

}

if(document.layers)

document.captureEvents(Event.MOUSEMOVE)

document.onmousemove=newPos

setInterval("cycle()",rate)

 

//-->

 

 

</SCRIPT>

 

0 Comments

Sun

08

Mar

2009

34、鼠标放上去出现提示框

34、鼠标放上去出现提示框

脚本说明:

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

<a href="" onMouseOver="alert('本站域名:http://www.njcatv.net');return true;">记住本站域名</a>

 

 

0 Comments

Sun

08

Mar

2009

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

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

脚本说明:

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

<SCRIPT Language="JavaScript">function winopen () {msg=open("update.htm","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

Thu

05

Mar

2009

32、围绕鼠标的立体星环

32、围绕鼠标的立体星环

<html>

 

<head>

<title>网页特效---围绕鼠标的立体星环</title>

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

 

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

 

</head>

 

<body bgcolor="#000000">

 

</body>

</html>

 

0 Comments

Thu

05

Mar

2009

31、围绕鼠标盘旋的鸟

31、围绕鼠标盘旋的鸟

<html>

 

<head>

<title>网页特效|---围绕鼠标盘旋的鸟</title>

 

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

</head>

 

<body>

<script language="JavaScript">

<!-- 

var images='sto/bird.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>

   

</body>

</html>

 

0 Comments