I have a clown friend who had me make them a very simple website a couple years ago, that included a cursor trail (rainbow colored hearts followed your cursor around the screen).
Now they have asked me to do an update, add a bunch of pages, and a lot of features.
Thing is, the internet (and especially IE) seems to actually follow no standards.
IE refuses to listen to anything I tell it as to the size to display pictures at. I can partly get around this by exactly sizing the pictures to the size I want them displayed at.
But the other two browsers I am currently using to test the site ... while they do a much better job of handling everything else on the page, and sizing things as I have requested them to, will not properly handle the cursor trails.
Oddly enough, Firefox displays the parts of the cursor trail across the top of the screen, and does no link to the cursor. They are just added as a line of graphics across the top of the screen.
Google Chrome is even odder ... it displays them as a vertical line, down the left side of the page, does not link them to the actual cursor, and only begin the proper page display after the cursor graphics.
Attached is the code for the cursor trail. Can anybody either explain how to make it work with other browsers, or possibly provide another code for cursor trails, that would work on more browsers?
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
/*
Rainbow Hearts Cursor Trail
Visit http://rainbow.arch.scriptmania.com for this script and more
*/
B=document.all;
C=document.layers;
T1=new gif",45,45,"h2.gif",45,45,"h1.gif",45,45)
nos=parseInt(T1.length/3)
rate=50
ie5fix1=0;
ie5fix2=0;
for (i=0;i<nos;i++){
createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+T1[i*3]+"' width="+T1[(i*3+1)]+" height="+T1[(i*3+2)]+" border=0>")}
function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){
with (document){
write((!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((B)?"'":"");
write((At)? At+">" : ">");
write((HT) ? HT : "");
if (!Op)
closeContainer(N)
}
}
function closeContainer(){
document.write((B)?"</div>":"</layer>")
}
function getXpos(N){
return (B) ? parseInt(B[N].style.left) : C[N].left
}
function getYpos(N){
return (B) ? parseInt(B[N].style.top) : C[N].top
}
function moveContainer(N,DX,DY){
c=(B) ? B[N].style :C[N];c.left=DX;c.top=DY
}
function cycle(){
//if (IE5)
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){
Y+ie5fix2:e.pageY+2
)
}
if(document.layers)
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=newPos
setInterval("cycle(1)",rate)
-->
</SCRIPT>