Programalama > JAVA SCRIPT

Etiketler: mouse, takip, kodu

Ort. 0
Puan ver:
<html> 

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> 
<title>z-mouse_animasyonu-6</title> 
</head> 

<body bgcolor="#000000" text="#FFFFFF"> 

<p> 
<script language="JavaScript"> 
<!--  
var ns=(document.layers)?1:0; 
var step=1; 
var cstep = 0; 
var a=0; 
var b=100; 
var Xpos=0; 
var Ypos=0; 
var n=7; 
var colours=new Array('ffffff','00ff00','aaaaff','ff00ff','ffa500','ff0000','fff000'); 
(document.layers)?window.captureEvents(Event.MOUSEMOVE):0; 
function Mouse(evnt){ 
Ypos = (document.layers)?evnt.pageY:event.y; 
Xpos = (document.layers)?evnt.pageX:event.x; 
} 
(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse; 
if (ns){ 
for (i=0; i < n; i++) 
document.write('<LAYER NAME="nsstars'+i+'" TOP=-200 LEFT=0 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 < n; 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>'); 
} 
function MorphSpin(){ 
var wdth=(document.layers)?window.innerWidth-100:document.body.clientWidth-100; 
var dot=(document.layers)?document.layers["nsstars"+0]:iestars[0].style; 
for (i = 0; i < n; i++){ 
dot.top=Ypos+a*Math.cos((cstep+i*4.5)/5); 
dot.left=Xpos+a*Math.sin((cstep+i*4.5)/5); 
} 
a+=1; 
cstep+=step; 
setTimeout('MorphSpin()',10); 
for (i = 0; i < n; i++){ 
var dots=(document.layers)?document.layers["nsstars"+i]:iestars[i].style; 
if (a >= 100){ 
a=100; 
step=2.5; 
dots.top=Ypos+a*Math.cos((cstep-100)*i/90); 
dots.left=Xpos+a*Math.sin((cstep-100)*i/90); 
} 
if (cstep > 182){ 
step=0.5; 
dots.top=Ypos+b*Math.cos(((cstep-182)+i*4.5)/5)*Math.cos((cstep-182)/5); 
dots.left=Xpos+b*Math.sin(((cstep-182)+i*4.5)/5); 
} 
} 
if (cstep > 210) b-=10; 
if (b < -wdth){ 
for (i = 0; i < n; i++){ 
(document.layers)?document.layers["nsstars"+i].top=-200:iestars[i].style.top=-200; 
} 
cstep=0; 
step=1; 
a=0; 
b=100; 
} 
} 
MorphSpin(); 
//--> 
</script> 
</p> 

</body> 

</html>


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.