Web Analytics Made Easy -
StatCounter trailer cursor! - CodingForum

Announcement

Collapse
No announcement yet.

trailer cursor!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • trailer cursor!

    I am so close to pulling my hair out!! I know what I'm going to say is elementary (as I apparently am) but...

    I CAN'T GET A TRAILER CURSOR TO WORK!! PERIOD!!

    I have the images in the same folder as the page, and following is the code that I placed on the web page:

    <script>

    /*
    Cross browser cursor trailer script
    By Brian Caputo ([email protected])
    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("trail1.gif",38,35,"trail2.gif",30,31,"trail3.gif",28,26,"trail4.gif",22,21,"trail5.gif",16,16 ,"trail6.gif",10,10)
    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){
    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>


    Will someone PLEASE tell me what I'm doing wrong??!?!?!

  • #2
    There's nothing wrong with the script that I can see. If you uploaded the images to the same directory as the page you have this script on, as you said you did, there's no obvious reason for the script not to work for you.

    What other scripts do you have on the page? One possible cause for this script not working could be some conflicts with other scripts on your page. Just for testing purposed (process of elimination), try creating a seperate page with just the cursor trail script on it, upload it to the directory where you have the required images, and see if the script works. If so, then there's probably a conflict with another script on the page you're trying to use this script on.

    Could you post a link to the page you currently have this script installed on? Good luck .
    boxer_1
    CodingForum Moderator
    "How did a fool and his money get together in the first place?"

    Comment

    Working...
    X