Search this site!

Return to the CSB Support home page
Roaming Cursor   |   Cursor Trail   |   Horizontal Scroll
Cursor Trail
Description:
Here's another mouse trail from Dynamic Drive that has been modified using mushroom gifs from Joyce Kohl.  She has three pages of various cursor trails you can choose from. Personally, I find these things distracting, but if you lik 'em, that's all that counts!
How to use:
1. First go to the Dynamic Drive page and read the information  about the 'Cursor trail' feature

2. Download both files I provide, and unpack the Zip file

3. Insert a BYOWG on the page where you want the mouse trail to appear

4. Copy the script that I provide into the BYOWG.  Then click on the 'Files for this gem' and insert all 6 mushroom gif files.


5. Click on 'Modify', save and publish your Trellix file and check out the results!

Example:
Download the code
right click on link, then click on 'Save target (or frame) as'
cursortrail.txt    <- Source code

mushroom-b.zip    <- Zip file of gif images

   
Other information:
For more scripts, go to Dynamic Drive

Source code:
(line to be modified is highlighted)
<script>

/*
Cross browser cursor trailer script
By Brian Caputo (bcaputo@icdc.com)
Permission given to Dynamicdrive.com
to feature the script in it's DHTML archive
For 100's more DHTML scripts and components,
visit Dynamicdrive.com
*/

B=document.all;
C=document.layers;
T1=new Array("mushroom-b1.gif",23,22,"mushroom-b2.gif",28,26,"mushroom-b3.gif",30,29,"mushroom-b4.gif",33,32,"mushroom-b5.gif",35,33,"mushroom-b6.gif",36,34)
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='^GEMDIR/"+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){
moveContainer("CUR"+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2
)
}
if(document.layers)
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=newPos
setInterval("cycle()",rate)
</script>