About This Script
Add this to your page by pasting the code (below) anywhere inside the <body> tag.
Demo
Click here to see a demo:
Demo Code
<script>
/**
* Bubble cursor trail
* Provided by http://www.top-site-list.com
*/
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(e){if(A)return parseInt(document.getElementById(e).style.left);else if(B)return parseInt(B[e].style.left);else return C[e].left}function getYpos(e){if(A)return parseInt(document.getElementById(e).style.top);else if(B)return parseInt(B[e].style.top);else return C[e].top}function moveContainer(e,t,n){c=A?document.getElementById(e).style:B?B[e].style:C?C[e]:"";if(!B){rightedge=window.innerWidth-T1[1]-20;bottomedge=window.pageYOffset+window.innerHeight-T1[2]}c.left=Math.min(rightedge,t+offsetx);c.top=Math.min(bottomedge,n+offsety)}function cycle(){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]}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,"","<img src='http://www.top-site-list.com/scripts/assets/bubble-cursor-trail/"+T1[i*3]+"' width="+T1[i*3+1]+" height="+T1[i*3+2]+" border=0>")}if(B){window.onload=getedgesIE;window.onresize=getedgesIE}if(document.layers)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=newPos;setInterval("cycle()",rate)
</script>
More scripts