View Full Version: dng chữ nhảy ma theo chuột !

Trang Chủ > javascript > dng chữ nhảy ma theo chuột !


Title: dng chữ nhảy ma theo chuột !
Description: chỉ chuột đi đu chữ nhảy theo đ


dinhvanmanh - November 14, 2004 06:00 AM (GMT)
dng trong HTML
CODE
<HTML>
<HEAD>
<TITLE>{--} Javascript - DONG CHU NHAY MUA VA XOAY THEO CHUOT</TITLE>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<STYLE type=text/css>A:link {
COLOR: #990000; TEXT-DECORATION: none
}
A:visited {
COLOR: #99ccff; TEXT-DECORATION: none
}
A:hover {
COLOR: red; TEXT-DECORATION: underline
}
</STYLE>

<META content="MSHTML 5.00.3700.6699" Tn thnh vin=GENERATOR>
</HEAD>
<BODY bgColor=#000000 onload=makesnake()
style="OVERFLOW-X: hidden; OVERFLOW-Y: scroll; WIDTH: 100%">
<script>
var msg='Welcome to [URL=http://hp.very.to';]http://hp.very.to';[/URL]

var font='Verdana,Arial';
var size=2;
var color='#FF00FF';
var speed=.3;
var rotation=.4;
var ns=(document.layers);
var ie=(document.all);
var msg=msg.split('');
var n=msg.length;
var a=size*15;
var currStep=0;
var ymouse=0;
var xmouse=0;
var scrll=0;
var Text="<font face="+font+" size="+size+" color="+color+">";

if (ie)
window.pageYOffset=0

if (ns){
for (i=0; i < n; i++)
document.write('<layer Tn thnh vin="nsmsg'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+Text+msg[i]+'</font></center></layer>');
}
if (ie){
document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="iemsg" style="position:absolute;top:0px;left:0;height:'+a+';widt h:'+a+';text-align:center;font-weight:regular;cursor:default">'+Text+msg[i]+'</font></div>');
document.write('</div></div>');
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;

function Mouse(evnt){
ymouse = (ns)?evnt.pageY+20-(window.pageYOffset):event.y;
xmouse = (ns)?evnt.pageX+20:event.x-20;
}

if (ns||ie)
(ns)?window.onMouseMove=Mouse:document.onmousemove =Mouse;
y=new Array();
x=new Array();
Y=new Array();
X=new Array();
for (i=0; i < n; i++){
y[i]=0;
x[i]=0;
Y[i]=0;
X[i]=0;
}

function Rotate(){
if (ie) outer.style.top=document.body.scrollTop;
currStep-=rotation;
for (i=0; i < n; i++){
var d=(ns)?document.layers['nsmsg'+i]:iemsg[i].style;
d.top=y[i]+a*Math.sin((currStep+i*1)/3.8)+window.pageYOffset-15;
d.left=x[i]+a*Math.cos((currStep+i*1)/3.8)*2;
}
}

function MouseText(){
scrll=(ns)?window.pageYOffset:0;
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed*5);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed*5);
for (var i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);

}
Rotate();
setTimeout('MouseText()',10);
}
if (ns||ie)window.onload=MouseText;

</SCRIPT>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<FONT
color=#000000 face=verdana size=1><B>Copyright by Tearsofdragon
<A
href="mailto:boy_love_girl_tocdai@yahoo.com" title="{ hello ba con}"><B>
<FONT color=red>Tearsofdragon</B></A>. </FONT></B></FONT></BODY></HTML >




* Hosted for free by InvisionFree