<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Fine JS Mouse Follow code </title>
<body>
<script>
A=document.getelementbyid
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, "Trail6.gif", 10,10)
var offsetx=15
var offsety=10
Nos=parseint (T1.LENGTH/3)
Rate=50
ie5fix1=0;
ie5fix2=0;
Rightedge=b? DOCUMENT.BODY.CLIENTWIDTH-T1[1]: window.innerwidth-t1[1]-20
Bottomedge=b? DOCUMENT.BODY.SCROLLTOP+DOCUMENT.BODY.CLIENTHEIGHT-T1[2]: window.pageyoffset+window.innerheight-t1[2]
for (i=0;i<nos;i++) {
CreateContainer ("CUR" +i,i*10,i*10,i*3+1,i*3+2, "", "
Border=0> ")
}
function CreateContainer (n,xp,yp,w,h,at,ht,op,st) {
With (document) {
Write (! A &&! 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 ((A | | B)? "'": "");
Write (at)? At+ ">": ">");
Write ((HT)? HT: "");
if (! OP)
Closecontainer (N)
}
}
function Closecontainer () {
document.write (A | | B)? " </div> ":" </layer> ")
}
function Getxpos (N) {
if (A)
Return parseint (document.getElementById (N). Style.left)
else if (B)
return parseint (B[n].style.left)
Else
Return C[n].left
}
function Getypos (N) {
if (A)
Return parseint (document.getElementById (N). Style.top)
else if (B)
return parseint (B[n].style.top)
Else
Return C[n].top
}
function Movecontainer (n,dx,dy) {
C= (A)? document.getElementById (N). Style: (B)? B[n].style: (C)? C[n]: "";
if (! B) {
Rightedge=window.innerwidth-t1[1]-20
BOTTOMEDGE=WINDOW.PAGEYOFFSET+WINDOW.INNERHEIGHT-T1[2]
}
C.left=math.min (Rightedge, DX+OFFSETX);
C.top=math.min (Bottomedge, dy+offsety);
}
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)
}
function Getedgesie () {
RIGHTEDGE=DOCUMENT.BODY.CLIENTWIDTH-T1[1]
BOTTOMEDGE=DOCUMENT.BODY.SCROLLHEIGHT-T1[2]
}
if (B) {
Window.onload=getedgesie
Window.onresize=getedgesie
}
if (document.layers)
Document.captureevents (Event.mousemove)
Document.onmousemove=newpos
SetInterval ("cycle ()", rate)
</script>
<div><a href= "http://www.999jiujiu.com/" >http://www.999jiujiu.com/</A></div>
</body>
Beautiful JS Mouse effect code follow