Programmabile Mouse Trail Script
Istruzione:
1: Copia e incolla lo jscript nella sezione BODY della tua pagina web;
Seleziona tutto...
<script language="javascript"> var numberimgs=10; // NUMBER OF TOTAL IMAGES TO FOLLOW THE MOUSE var begW=80; // STARTING WIDTH OF THE IMAGES var endW=20; // ENDING WIDTH OF THE IMAGES var begH=20; // STARTING HEIGHT OF THE IMAGES var endH=80; // ENDING HEIGHT OF THE IMAGES var imgurl='circle.gif'; // YOUR PICTURE NAME. WILL BE AUTOMATICALLY "SCALED" BASED ON ABOVE SETTINGS. var delay=60; // SPEED OF TRAIL var Xoff=-80; // AMOUNT OF PIXELS TO THE RIGHT IMAGE WILL BE AWAY FROM CURSOR (- VALUES GO TO LEFT) var Yoff=-80; // AMOUNT OF PIXELS TO THE BOTTOM IMAGE WILL BE AWAY FROM CURSOR (- VALUES GO UP) //////////////// NO NEED TO EDIT BEYOND THIS POINT \\\\\\\\\\\\\\\ var ns4=(document.layers)?true:false; var ns6=(document.getElementById&&navigator.appName.indexOf("Netscape")>=0)?true:false; var ie4=(document.all&&!document.getElementById)?true:false; var ie5=(document.all&&document.getElementById)?true:false; var stepH=(begH-endH)/numberimgs; var stepW=(begW-endW)/numberimgs; var xcoord=new Array(); var ycoord=new Array(); for(i=0;i<=numberimgs;i++){ xcoord[i]=0; ycoord[i]=0; } var mImgs=new Array(); var t=''; for(i=1;i<=numberimgs;i++){ t+=(ns4)?'
':'
'; t+='
'; t+=(ns4)?'':'
'; } document.write(t); function getmousecoord(evt){ xcoord[1]=Xoff+((ie4||ie5)?event.clientX+document.body.scrollLeft:evt.pageX); ycoord[1]=Yoff+((ie4||ie5)?event.clientY+document.body.scrollTop:evt.pageY); if(!ns6)moveid(mImgs[1], xcoord[1], ycoord[1]); } function moveid(id,x,y){ if(ns4)id.moveTo(x,y); else{ id.style.left=x; id.style.top=y; }} function moveimgs(){ for(i=numberimgs;i>1;i=i-1){ xcoord[i]=xcoord[i-1]+stepW/2; ycoord[i]=ycoord[i-1]+stepH/2; } for(i=2;i<=numberimgs;i++)moveid(mImgs[i], xcoord[i], ycoord[i]); } window.onload=function(){ for(i=1;i<=numberimgs;i++)mImgs[i]=(ns4)?document.layers['img'+i]:(ie4)?document.all['img'+i]:document.getElementById('img'+i); if(ns4)document.captureEvents(Event.MOUSEMOVE); document.onmousemove=getmousecoord; if(ns6)setInterval('moveid(mImgs[1],xcoord[1],ycoord[1])',10); setInterval('moveimgs()',delay); } </script>
2: Aggiusta il settaggio dello script a tuo piacimento