Mouse Trail Code

10:56:00 PM |

<!--**THIS CODE IS IN 3 SECTIONS!! SCROLL DOWN TO THE BOTTOM TO FIND INSTRUCTIONS.**-->
<!--**DELETE THESE AND THE OTHER INSTRUCTION COMMENTS BEFORE PASTING**-->


<!--**1 - PASTE THE FOLLOWING PIECE OF CODE INTO THE HEAD SECTION OF YOUR WEBPAGE**-->

<style type="text/css">
<!--
.mouse
{
position:absolute;
visibility:visible;
top:-50px;
font-size:8px;
font-family:arial;
color:green;
}
body
{
width:100%;
overflow-x:hidden;
overflow-y:scroll;
}
-->
</style>
<script>
var x,y
var step=20
var doit=0
var text="ns-Services "
text=text.split("")

var xpos=new Array()
for (i=0;i<=text.length-1;i++) {
xpos[i]=-50
}

var ypos=new Array()
for (i=0;i<=text.length-1;i++) {
ypos[i]=-50
}

function anddo(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
doit=1
}

function trail() {
if (doit==1 && document.all) {
    for (i=text.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<text.length-1; i++) {
    var place = eval("span"+(i)+".style")
    place.posLeft=xpos[i]
place.posTop=ypos[i]
    }
}

else if (doit==1 && document.layers) {
    for (i=text.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<text.length-1; i++) {
    var place = eval("document.span"+i)
    place.left=xpos[i]
place.top=ypos[i]
    }
}
var timer=setTimeout("trail()",30)
}

</script>


<!--**2 - PASTE THE FOLLOWING PIECE OF CODE INTO THE BODY SECTION OF YOUR WEBPAGE**-->

<script>
<!-- Beginning of JavaScript -

for (i=0;i<=text.length-1;i++) {
    document.write("<span id='span"+i+"' class='mouse'>")
document.write(text[i])
    document.write("</span>")
}

if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = anddo;

// - End of JavaScript - -->
</script>

<!--**3 - USE THE FOLLOWING PIECE OF CODE AS THE BODY TAG OF YOUR WEBPAGE**-->

<body onLoad="trail()">