Want some words to follow your cursor on your site? How about a phrase? This little handy script allows you to do just that.
Copy and paste the following into your <HEAD> tags:
Add this code to your <BODY> tag:
Add this code in the body of your document:
Copy and paste the following into your <HEAD> tags:
Code:
<script language="Javascript">
/*
Cheesy Mouse Trails
Copyright Al Sparber (www.projectseven.com)
*/
var x,y
var step=20
var flag=0
//Set speed. Higher number is slower and more elastic.
var speed=60
//Change text. Must leave space between end of text and closing!
var message="Cheese from DHTML Shock "
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50
}
function SviiTrailer(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function HappyTrails() {
if (flag==1 && document.all) {
for (i=message.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<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}
else if (flag==1 && document.layers) {
for (i=message.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<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("HappyTrails()",speed)
}
</script>
<style type="text/css">
/*
SviiTrailer
*/
.cheesey{position:absolute;visibility:visible;top:-50px;
font-size:10px;font-family:"Trebuchet MS", Verdana, Arial, sans-serif;
font-weight:bold;color:#FFFFFF;}
</style>
Code:
<BODY onLoad='HappyTrails();'>
Code:
<script>
/*
SviiTrailer
*/
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"' class='cheesey'>")
document.write(message[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = SviiTrailer;
</script>



.com .info
We're the affordable, reliable place to host your site. And unlike the competition, there's no set up fee and no annual commitment.
Our highly trained, courteous support staff is waiting to help. We'll resolve any issue to your complete satisfaction.