Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
/*<![CDATA[*/
/*
Snoopy Follow Cursor Trail
Visit http://www.rainbow.arch.scriptmania.com/scripts/
*/
var w=32; // the snoopy width
var h=32; // the snoopy height
var f=0.3; // f = the speed of the 'follow mouse' from .001 to 1
var x=47; // x = the horizontal distance from the mouse when stationary
var y=0; // y = the horizontal distance from the mouse when stationary
var imgs=['http://rainbow.arch.scriptmania.com/scripts/snoop.gif','http://rainbow.arch.scriptmania.com/scripts/snoopr.gif','http://rainbow.arch.scriptmania.com/scripts/snoopl.gif']
function MoveSnoop(){
var fly=document.getElementById('fly'),nu;
if (Math.abs(XY[0]-xy[0])>=10) {
xy[0]+=Math.floor((XY[0]-xy[0])*f);
}
else if (XY[0]!=xy[0]) {
xy[0]+=Math.abs(XY[0]-xy[0])/(XY[0]-xy[0]);
}
if (Math.abs(XY[1]-xy[1])>=10) {
xy[1]+=Math.floor((XY[1]-xy[1])*f);
}
else if (XY[1]!=xy[1]) {
xy[1]+=Math.abs(XY[1]-xy[1])/(XY[1]-xy[1]);
}
nu=Math.abs(xy[0]-XY[0])<10?0:xy[0]-XY[0]<10?1:2;
if (nu!=Nu){
fly.src=imgs[nu];
Nu=nu;
}
fly.style.left=xy[0]+x+'px';
fly.style.top=xy[1]+y+'px';
}
function MainMouseEvent(e){
var e=e||window.event;
if (window.event){
var docs=[document.body.scrollLeft,document.body.scrollTop];
if (!document.body.scrollTop){
docs=[document.documentElement.scrollLeft,document.documentElement.scrollTop];
}
XY=[e.clientX+docs[0],e.clientY+docs[1]];
}
else {
XY=[e.pageX,e.pageY];
}
}
var Nu=0;
var xy=[-w,-h];
var XY=[-w,-h];
f=Math.max(Math.min(f,1),.001);
document.write('<IMG id="fly" SRC="'+imgs[Nu]+'" border=0 style="position:absolute;z-Index:101;top:-1000px; left:-1000px; width:'+w+'px; height:'+h+'px;">')
document.onmousemove = function(e){ MainMouseEvent(e); }
setInterval(function(){ MoveSnoop(); },50)
/*]]>*/
</script>
</body>
</html>
Bookmarks