Web Analytics Made Easy -
StatCounter conflict w/image trail and imagew/description tooltip - CodingForum

Announcement

Collapse
No announcement yet.

conflict w/image trail and imagew/description tooltip

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

  • conflict w/image trail and imagew/description tooltip

    Hi there,

    I am trying to use the image trail script and the image w/description tooltip script, both from Dynamic Drive, on the same page. I have found window.onload handlers on both scripts. I've tried putting them in the body tag and that didn't help. I've also found window.onresize in both scripts. I also tried putting both of them in the body tag (I didn't know if that was the right thing to do or not) but that didn't help either. The image script goes in the head with a divid tag just before the </body>. The image trail goes in the body. I've even tried moving them around. Still, no help. I've also spent several hours looking through other posts and have seen alot of interesting stuff, but I think I must be too thickheaded to figure how it applies to my situation.

    FYI, the image trail script works, but not the image w/description tooltip script.

    The page I'm working on is www.kcloosechangeband.com/photo.htm

    I have disabled the trail for now, because it's more important for the other deal to work.

    I'm sure there must be some duplicate something I'm overlooking or I just have a huge lack of knowledge. Will somebody please lend me their eyes and possibly some brains too?!

    Below is the script for the image trail. I've only included this one because the other one is on the web page and I didn't have enough room for both of them here. (I guess I talk too much.)

    /******************************************
    * Cross browser cursor trailer script- By Brian Caputo ([email protected])
    * Visit Dynamic Drive (http://www.dynamicdrive.com/) for full source code
    * Modified Dec 31st, 02' by DD. This notice must stay intact for use
    ******************************************/

    A=document.getElementById
    B=document.all;
    C=document.layers;
    T1=new Array("http://www.kcloosechangeband.com/images/startrail1.gif",38,35,"http://www.kcloosechangeband.com/images/startrail2.gif",30,31,"http://www.kcloosechangeband.com/images/startrail3.gif",28,26,"http://www.kcloosechangeband.com/images/startrail4.gif",22,21,"http://www.kcloosechangeband.com/images/startrail5.gif",16,16,"http://www.kcloosechangeband.com/images/startrail6.gif",10,10)

    var offsetx=15 //x offset of trail from mouse pointer
    var offsety=10 //y offset of trail from mouse pointer

    nos=parseInt(T1.length/3)
    rate=50
    ie5fix1=0;
    ie5fix2=0;
    rightedge=B? document.body.clientWidth-T1[1] : window.innerWidth-T1[1]-20
    bottomedge=B? document.body.scrollTop+document.body.clientHeight-T1[2] : window.pageYOffset+window.innerHeight-T1[2]

    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((!A && !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((A || B)?"'":"");
    write((At)? At+">" : ">");
    write((HT) ? HT : "");
    if (!Op)
    closeContainer(N)
    }
    }

    function closeContainer(){
    document.write((A || B)?"</div>":"</layer>")
    }

    function getXpos(N){
    if (A)
    return parseInt(document.getElementById(N).style.left)
    else if (B)
    return parseInt(B[N].style.left)
    else
    return C[N].left
    }

    function getYpos(N){
    if (A)
    return parseInt(document.getElementById(N).style.top)
    else if (B)
    return parseInt(B[N].style.top)
    else
    return C[N].top
    }

    function moveContainer(N,DX,DY){
    c=(A)? document.getElementById(N).style : (B)? B[N].style : (C)? C[N] : "";
    if (!B){
    rightedge=window.innerWidth-T1[1]-20
    bottomedge=window.pageYOffset+window.innerHeight-T1[2]
    }
    c.left=Math.min(rightedge, DX+offsetx);
    c.top=Math.min(bottomedge, DY+offsety);
    }
    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)
    }

    function getedgesIE(){
    rightedge=document.body.clientWidth-T1[1]
    bottomedge=document.body.scrollHeight-T1[2]
    }

    if (B){
    window.onload=getedgesIE
    window.onresize=getedgesIE
    }

    if(document.layers)
    document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove=newPos
    setInterval("cycle()",rate)
    </script>

    ********************
    Thanks,
    T
    Last edited by tamermom; Feb 23, 2004, 06:30 AM.
Working...
X