Code <br><script language="javascript">
// ENTER TEXT BELOW. CAN *NOT* INCLUDE NORMAL HTML CODE. <br> var text='ТУТ СЛОВА НА АНГЛИЙСКОМ'; </p>
var delay=40; // SPEED OF TRAIL <br> var Xoff=0; // PIXEL COUNT FROM THE LEFT OF THE CURSOR (- VALUES GO TO LEFT) <br> var Yoff=-30; // PIXEL COUNT FROM THE TOP OF THE CURSOR (- VALUES GO UP) <br> var txtw=14; // AMOUNT OF PIXEL SPACE EACH CHARACTER OCCUPIES <br> var beghtml='<font color="blue"><b>'; // OPTIONAL HTML CODE THAT EFFECTS WHOLE TEXT STRING SUCH AS FONT COLOR, SIZE, ETC. <br> var endhtml='</b></font>'; // END HTML CODE. MOSTLY USED IF ABOVE SETTING IS USED. </p>
//********** NO NEED TO EDIT BELOW HERE **********\\ </p>
ns4 = (navigator.appName.indexOf("Netscape")>=0 && document.layers)? true : false; <br> ie4 = (document.all && !document.getElementById)? true : false; <br> ie5 = (document.all && document.getElementById)? true : false; <br> ns6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false; <br> var txtA=new Array(); <br> text=text.split(''); <br> var x1=0; <br> var y1=-1000; <br> var t=''; </p>
for(i=1;i<=text.length;i++){ <br> t+=(ns4)? '<layer name="txt'+i+'" top="-100" left="0" width="'+txtw+'" height="1">' : '<div id="txt'+i+'" style="position:absolute; top:-100px; left:0px; height:1px; width:'+txtw+'; visibility:visible;">'; <br> t+=beghtml+text[i-1]+endhtml; <br> t+=(ns4)? '</layer>' : '</div>'; <br> } <br> document.write(t); </p>
function moveid(id,x,y){ <br> if(ns4)id.moveTo(x,y); <br> else{ <br> id.style.left=x+'px'; <br> id.style.top=y+'px'; <br> }} </p>
function animate(evt){ <br> x1=Xoff+((ie4||ie5)?event.clientX+document.body.scrollLeft:evt.pageX); <br> y1=Yoff+((ie4||ie5)?event.clientY+document.body.scrollTop:evt.pageY); <br> } </p>
function getidleft(id){ <br> if(ns4)return id.left; <br> else return parseInt(id.style.left); <br> } </p>
function getidtop(id){ <br> if(ns4)return id.top; <br> else return parseInt(id.style.top); <br> } </p>
function getwindowwidth(){ <br> if(ie4||ie5)return document.body.clientWidth+document.body.scrollLeft; <br> else return window.innerWidth+pageXOffset; <br> } </p>
function movetxts(){ <br> for(i=text.length;i>1;i=i-1){ <br> if(getidleft(txtA[i-1])+txtw*2>=getwindowwidth()){ <br> moveid(txtA[i-1],0,-1000); <br> moveid(txtA[i],0,-1000); <br> }else moveid(txtA[i], getidleft(txtA[i-1])+txtw, getidtop(txtA[i-1])); <br> } <br> moveid(txtA[1],x1,y1); <br> } </p> window.onload=function(){ <br> for(i=1;i<=text.length;i++)txtA[i]=(ns4)?document.layers['txt'+i]:(ie4)?document.all['txt'+i]:document.getElementById('txt'+i);
<br> if(ns4)document.captureEvents(Event.MOUSEMOVE); <br> document.onmousemove=animate; <br> setInterval('movetxts()',delay); <br> } <br> </script> <br>
|