Announcement

Collapse
No announcement yet.

Help with script

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

  • Help with script

    Please look on my website below select "results" and "day 1" from the menu bar. You will see i've used a script from rainbow arch which allows me to have a glider follow the cursor (orginally it was snoopy but i changed images). Problem is the image doesnt change direction like it should. In fact when i go to rainbowarch wher i got the script the same thing happens so i suspect it is a fault in the code. Can anyone out there tell me how to correct the code ? http://www.rainbow.arch.scriptmania....sor_trail.html
    www.glidingcomp.com

  • #2
    Re: Help with script

    It changes direction on their site for me on IE - but annoyed me so much that I wouldn't stay on a site with it - might be cute on a kids site tho where parents aren't going there.

    And remember it won't work at all on Firefox - I had to remember that and switch to IE to look at it.
    Beth
    A Child's Palace - Pinata Palace - Moxie Enterprises

    SEO and Marketing Tools
    SEO - The Basics

    Comment


    • #3
      Re: Help with script

      Originally posted by MrCirrus
      Please look on my website below select "results" and "day 1" from the menu bar. You will see i've used a script from rainbow arch which allows me to have a glider follow the cursor (orginally it was snoopy but i changed images). Problem is the image doesnt change direction like it should. In fact when i go to rainbowarch wher i got the script the same thing happens so i suspect it is a fault in the code. Can anyone out there tell me how to correct the code ? http://www.rainbow.arch.scriptmania....sor_trail.html

      Ok I download the snoopy script etc, this is how it looks on my test page, works well lol


      For the glider do you have 3 views of it like the snoopy pics? or some where I can get them, then I can run another test page and work the bugs out ::P

      For the main script copy and paste "Between Head Tag"
      Dave Hickey

      www.youngstroke.org.nz

      www.eko.co.nz

      Comment


      • #4
        Re: Help with script

        It works BOTH on their site AND on yours. At least it did for me.
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment


        • #5
          Re: Help with script

          Ok the glider moves around. But it should face right when you move the cursor right, and face left when you move cursor left. My glider just faces down all the time and when i look at the rainbow script, snoopy only faces in one direction all the time as you move the cursor yet there are three snoopies that face in different directions. Dave i've added extra pictures for you to play with on the page (just rotated the down facing image). I know it all seems rather pathetic playing around with this but i get great pleasure in solving these problems.Or should i say getting you lot to solve them for me!!!
          www.glidingcomp.com

          Comment


          • #6
            Re: Help with script

            Hey Mate

            Here you go copy script and paste "Between Head Tag" main html

            <SCRIPT type="text/javascript">
            /*


            var Ver4=parseInt(navigator.appVersion.charAt(0))>=4
            var IE=navigator.appName.indexOf("Microsoft")!=-1
            var al, imagesrc, ex=-32, ey=-32, x0=-32, y0=-32

            function Moveglider()
            {
            if (Math.abs(ex-x0)>=10) { x0+=Math.floor((ex-x0)*0.1) }
            else if (ex!=x0) { x0+=Math.abs(ex-x0)/(ex-x0) }
            if (Math.abs(ey-y0)>=10) { y0+=Math.floor((ey-y0)*0.1) }
            else if (ey!=y0) { y0+=Math.abs(ey-y0)/(ey-y0) }

            imagesrc=""
            if ( (ex<x0) && ( (x0-ex) > Math.abs(y0-ey)/2 ) )
            { imagesrc="gliderL.gif"
            if ( (x0-ex) < Math.abs(y0-ey)*2 )
            { if (ey<y0) imagesrc="gliderL.gif"
            if (ey>y0) imagesrc="gliderL.gif"
            }
            }
            if ( (ex>x0) && ( (ex-x0) > Math.abs(y0-ey)/2) )
            { imagesrc="gliderR.gif"
            if ( (ex-x0) < Math.abs(y0-ey)*2 )
            { if (ey<y0) imagesrc="gliderR.gif"
            if (ey>y0) imagesrc="gliderR.gif"
            }
            }
            if (imagesrc=="")
            { if (ey<y0) imagesrc="gliderR.gif"
            if (ey>y0) imagesrc="gliderR.gif"
            if ((ex==x0)&&(ey==y0)) imagesrc="glide.gif"
            }

            if (Ver4)
            { if (!IE)
            { document.FlyLayer.document.images.fly.src=imagesrc }
            else document.all.FlyLayer.document.images.fly.src=imag esrc
            }
            al.left=x0-47
            al.top=y0

            setTimeout("Moveglider();",100)
            }

            function MainMouseEvent(e)
            {
            if (Ver4)
            { if (!IE)
            { ex=e.pageX
            ey=e.pageY }
            else
            { ex=event.clientX + document.body.scrollLeft
            ey=event.clientY + document.body.scrollTop }
            }
            }

            function ScriptSetup()
            {
            isIm = (document.images) ? 1 : 0
            if (isIm)
            { arImLoad = new Array
            ('glider','gliderL','gliderR')
            arImList = new Array ()
            for (counter in arImLoad)
            { arImList[counter] = new Image()
            arImList[counter].src = arImLoad[counter] + '.gif'
            }
            }

            if (Ver4)
            { if (!IE)
            { al=document.FlyLayer
            document.captureEvents(Event.MOUSEMOVE)
            }
            else
            { al=document.all.FlyLayer.style }
            document.onmousemove = MainMouseEvent
            Moveglider()
            }
            }

            function Showglider()
            {
            if(Ver4)
            { s ='<DIV STYLE="visibility:hidden"></DIV>'
            s+='<DIV ID="FlyLayer" STYLE="position:absolute; '
            s+='top:-32; left:-32; width:32; height:32">'
            s+=''
            s+='<IMG NAME="fly" SRC="glider.gif" border=0>'
            s+='</A></DIV>'
            document.writeln(s)
            }
            }

            window.onload = ScriptSetup
            Showglider()

            </SCRIPT>


            Copy the next code then open notepad paste and save file as "glider.js"

            /*
            glider Follow Cursor Trail

            */

            var Ver4=parseInt(navigator.appVersion.charAt(0))>=4
            var IE=navigator.appName.indexOf("Microsoft")!=-1
            var al, imagesrc, ex=-32, ey=-32, x0=-32, y0=-32

            function Moveglider()
            {
            if (Math.abs(ex-x0)>=10) { x0+=Math.floor((ex-x0)*0.1) }
            else if (ex!=x0) { x0+=Math.abs(ex-x0)/(ex-x0) }
            if (Math.abs(ey-y0)>=10) { y0+=Math.floor((ey-y0)*0.1) }
            else if (ey!=y0) { y0+=Math.abs(ey-y0)/(ey-y0) }

            imagesrc=""
            if ( (ex<x0) && ( (x0-ex) > Math.abs(y0-ey)/2 ) )
            { imagesrc="glider.gif"
            if ( (x0-ex) < Math.abs(y0-ey)*2 )
            { if (ey<y0) imagesrc="gliderL.gif"
            if (ey>y0) imagesrc="gliderL.gif"
            }
            }
            if ( (ex>x0) && ( (ex-x0) > Math.abs(y0-ey)/2) )
            { imagesrc="snoopr.gif"
            if ( (ex-x0) < Math.abs(y0-ey)*2 )
            { if (ey<y0) imagesrc="gliderR.gif"
            if (ey>y0) imagesrc="gliderR.gif"
            }
            }
            if (imagesrc=="")
            { if (ey<y0) imagesrc="glider.gif"
            if (ey>y0) imagesrc="glider.gif"
            if ((ex==x0)&&(ey==y0)) imagesrc="glider.gif"
            }

            if (Ver4)
            { if (!IE)
            { document.AlienLayer.document.images.alien.src=imag esrc }
            else document.all.AlienLayer.document.images.alien.src= imagesrc
            }
            al.left=x0-47
            al.top=y0

            setTimeout("Moveglider();",100)
            }

            function MainMouseEvent(e)
            {
            if (Ver4)
            { if (!IE)
            { ex=e.pageX
            ey=e.pageY }
            else
            { ex=event.clientX + document.body.scrollLeft
            ey=event.clientY + document.body.scrollTop }
            }
            }

            function ScriptSetup()
            {
            isIm = (document.images) ? 1 : 0
            if (isIm)
            { arImLoad = new Array
            ('glider','gliderL','gliderR')
            arImList = new Array ()
            for (counter in arImLoad)
            { arImList[counter] = new Image()
            arImList[counter].src = arImLoad[counter] + '.gif'
            }
            }

            if (Ver4)
            { if (!IE)
            { al=document.AlienLayer
            document.captureEvents(Event.MOUSEMOVE)
            }
            else
            { al=document.all.AlienLayer.style }
            document.onmousemove = MainMouseEvent
            Moveglider()
            }
            }

            function Showglider()
            {
            if(Ver4)
            { s ='<DIV STYLE="visibility:hidden"></DIV>'
            s+='<DIV ID="AlienLayer" STYLE="position:absolute; '
            s+='top:-32; left:-32; width:32; height:32">'
            s+=''
            s+='<IMG NAME="alien" SRC="glider.gif" border=0>'
            s+='</A></DIV>'
            document.writeln(s)
            }
            }

            window.onload = ScriptSetup
            Showglider()


            And for the html code box where the glider will start place this code thier

            <SCRIPT LANGUAGE=JavaScript src="glider.js"></SCRIPT>

            For the glider files I have loaded the pics on to the test page just copy and save as.......

            Dave Hickey

            www.youngstroke.org.nz

            www.eko.co.nz

            Comment


            • #7
              Re: Help with script

              Hi Stroke,

              it doesn't work for me in your test page. The glider is always facing down.
              Navaldesign
              Logger Lite: Low Cost, Customizable, multifeatured Login script
              Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
              DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
              Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

              Comment


              • #8
                Re: Help with script

                Originally posted by navaldesign
                Hi Stroke,

                it doesn't work for me in your test page. The glider is always facing down.

                Hey Naval

                The script that was off that site only works on angles not for stright L/R turns lol
                Dave Hickey

                www.youngstroke.org.nz

                www.eko.co.nz

                Comment


                • #9
                  Re: Help with script

                  Hi Dave, Thanks for your help with this. I tried http://www.eko.co.nz/test.php 5 hours ago and it worked perfectly. I,m trying it now and it just points down? I've tried modifying my page as you described, check I followed you correctly.
                  1 Copied and pasted first code to "between head" portion of page
                  2 Copied second part and saved it as glider.js i then COPIED THIS FILE INTO MY PUBLIC FOLDER - is that correct?
                  3 I then added the extra line of script into my HTML box on the page.
                  4 I also changed the naming of my existing gif images from snoopy to glider to match your code.

                  Regreatably it doesnt seem to work - have i done something wrong?
                  Thanks for your help, i appreciate the work youve put into solving this for me. BTW I like the use of your MS Agent on the http://www.nz-stroke.com/
                  www.glidingcomp.com

                  Comment


                  • #10
                    Re: Help with script

                    Originally posted by MrCirrus
                    Hi Dave, Thanks for your help with this. I tried http://www.eko.co.nz/test.php 5 hours ago and it worked perfectly. I,m trying it now and it just points down? I've tried modifying my page as you described, check I followed you correctly.
                    1 Copied and pasted first code to "between head" portion of page
                    2 Copied second part and saved it as glider.js i then COPIED THIS FILE INTO MY PUBLIC FOLDER - is that correct?
                    3 I then added the extra line of script into my HTML box on the page.
                    4 I also changed the naming of my existing gif images from snoopy to glider to match your code.

                    Regreatably it doesnt seem to work - have i done something wrong?
                    Thanks for your help, i appreciate the work youve put into solving this for me. BTW I like the use of your MS Agent on the http://www.nz-stroke.com/

                    OKs you are nearly there on my test page copy the 3 glider gif images and then load them up to server
                    Dave Hickey

                    www.youngstroke.org.nz

                    www.eko.co.nz

                    Comment


                    • #11
                      Re: Help with script

                      Now it works ok for me. However, a 4 direction script would be needed here. Seeing a glider moving backwards is, at least, unusual. Not Strokes fault of course, it's the original script that was intended to be like this.
                      Navaldesign
                      Logger Lite: Low Cost, Customizable, multifeatured Login script
                      Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                      DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                      Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                      Comment

                      Working...
                      X