Trailing Cursor Code ~
-----------------------------------<SCRIPT
language='JavaScript1.2'>
/*
Cross browser cursor trailer script
*/
V5=document.getElementById;B=document.all;C=document.layers;D=document.all&&window.print;E=V5&&!document.all;cC=new
Array();
T1=new Array("InChrist_c5.gif",45,45, "InChrist_c4.gif",45,45,
"InChrist_c3.gif",45,45, "InChrist_c2.gif",45,45,
"InChrist_c1.gif",45,45);
nos=parseInt(T1.length/3);
rate=100;
for (i=0;i<nos;i++)
createCell('CUR'+i,i*10,i*10,T1[i*3+1],T1[i*3+2],'','<img src="'+T1[i*3]+'"
width='+T1[(i*3+1)]+' height='+T1[(i*3+2)]+' border=0>')
function cycle(){for (i=0;i<(nos-1);i++){moveCell('CUR'+i,getXpos('CUR'+(i+1)),getYpos('CUR'+(i+1)))}}
function newPos(e){moveCell('CUR'+(nos-1),((B)?event.clientX+document.body.scrollLeft:e.pageX)+2,((B)?event.clientY+document.body.scrollTop:e.pageY)+2)}
//Here is the line I changed so both IE & NS move it over 2 pixels off the
pointers tip thus allowing linkage!
if(document.layers)document.captureEvents(Event.MOUSEMOVE);
if (B)document.body.onscroll=newPos;
document.onmousemove=newPos;
window.MTIRQ=setInterval('cycle()',rate);
function createCell(N, Xp, Yp,W,H,A,Ht,BG,O,S){
if (B||C||D||E){
with(document){
//NS4
if (C)write("<layer name='"+N+"' left="+Xp+" top="+Yp+" width="+W+"
height="+H )
//IE & Gecko
else write("<div id='"+N+"' style='position:absolute; left:"+Xp+";
top:"+Yp+"; width:"+W+"; height:"+H);
//BgColor
if (BG){
X=(C)?" BGColor=":"; background-color:";
write(X+BG)}
//Styles
if(S) write((C)?" style=' "+S+"'":"; "+S+"'")
//Close the Style attribute
else if(!C)write("'");
//Other Attributes
write((A)?" "+A+">":">");
//write Content'
write(Ht)}
//Close the Tag
if(!O)closeCell();
//Add to the Cell Collection array
cC[cC.length]=N;
XX=getObject2(N);
if(!C){XX.moveTo=moveTo;XX.moveBy=moveBy}else{XX.innerHTML=Ht}
//XX.refresh=refresh
}
};
function moveCell(N,Xp,Yp){D=getCell(N);D.left=Xp;D.top=Yp};
function getYpos(N){return (parseInt(getCell(N).top))};
function getXpos(N){return (parseInt(getCell(N).left))};
function closeCell(){document.write((!C)?"</div>":"</layer>")};
function getCell(N){
if (C)D=C[N];
else if (E)D=document.getElementById(N).style
else D=B[N].style;
if(D==null&&C){rr=C.length;for (i=0;i<rr;i++){D=C[i].document.layers;if(D)D=D[N];if(D)return
D}}return D}
function refresh(){if(B){document.all[this.id].innerHTML=this.innerHTML}else{changeContent(this.id,this.innerHTML)}}
function getObject2(N){
if (D||E)e=document.getElementById(N)
else e=(C)?C[N]:B[N];
if(!e&&C){rr=C.length;for (i=0;i<rr;i++){e=C[i].document.layers;if(e)e=e[N];if(e)
return e;}}return e}
</SCRIPT> |