Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: flying text

  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry flying text

    Hi guys i am having some problem with the flying text how do u g<h2><span id="fly"></span></h2>

    <script>
    window.onerror=new Function("return true")

    //Flying Letters script- by Matthias (info@freejavascripts.f2s.com)
    //For this script and more, visit http://www.dynamicdrive.com

    //Configure message to display. Use "$" for linebreak
    message = "Thanks for visiting Dynamic Drive!" // $ = taking a new line
    distance = 50 // pixel(s)
    speed = 100 // milliseconds

    if (!document.all)
    document.write('<h2>'+message+'</h2>')

    </script>

    <script language="JavaScript1.2">

    txt="";num=0;num4=0;flyofle="";flyofwi="";flyofto=""
    function stfly(){for(i=0;i != message.length;i++){if(message.charAt(i) != "$"){txt=txt+"<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"<\/span>"};else{txt=txt+"<br>"}};fly.innerHTML=txt;txt="";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidt h;flyofto=fly.offsetTop;fly2b()}
    function fly2b(){if(num4 != message.length){if(message.charAt(num4) != "$"){eval("n"+num4+".style.left=flyofle-n"+num4+".offsetLeft+flyofwi/2");eval("n"+num4+".style.top=flyofto-n"+num4+".offsetTop+distance");eval("fly3('n"+num4+"',eval(n"+num4+".style.left.substring(0,n"+num4+ ".style.left.length-2)),(eval(n"+num4+".style.left.substring(0,n"+num4+".style.left.length-2))/5),eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2)),(eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2))/5))")};num4++;setTimeout("fly2b()",speed)}}
    function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2) != 0 && Math.floor(top2) != -1) || (Math.floor(lef2) != 0 && Math.floor(lef2) != -1)){if(eval("'"+lef2+"'").charAt(0) != '-'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2) != -1){eval(target+".style.visibility='visible';"+target+".style.left=Math.floor(lef2)")};else{eval(targ et+".style.visibility='visible';"+target+".style.left=Math.floor(lef2+1)")};if(eval("'"+lef2+"'").ch arAt(0) != '-'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2) != -1){eval(target+".style.top=Math.floor(top2)")};else{eval(target+".style.top=Math.floor(top2+1)")};se tTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50)}};

    stfly()

    </script>o about changing text size , font, color and alignment of the text.
    Last edited by sundancer; 06-13-2003 at 03:56 AM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you post the script or link to it?
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    Saj
    Saj is offline
    Regular Coder
    Join Date
    Feb 2003
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are probably variables within the script which can allow font/color/size change of the text.
    - Saj

  • #4
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry

    hi yes this is the link



    http://dynamicdrive.com/dynamicindex10/flyletter.htm




    AND THIS IS THE CSRIPT



    <h2><span id="fly"></span></h2>

    <script>
    window.onerror=new Function("return true")

    //Flying Letters script- by Matthias (info@freejavascripts.f2s.com)
    //For this script and more, visit http://www.dynamicdrive.com

    //Configure message to display. Use "$" for linebreak
    message = "Thanks for visiting Dynamic Drive!" // $ = taking a new line
    distance = 50 // pixel(s)
    speed = 100 // milliseconds

    if (!document.all)
    document.write('<h2>'+message+'</h2>')

    </script>

    <script language="JavaScript1.2">

    txt="";num=0;num4=0;flyofle="";flyofwi="";flyofto=""
    function stfly(){for(i=0;i != message.length;i++){if(message.charAt(i) != "$"){txt=txt+"<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"<\/span>"};else{txt=txt+"<br>"}};fly.innerHTML=txt;txt="";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidt h;flyofto=fly.offsetTop;fly2b()}
    function fly2b(){if(num4 != message.length){if(message.charAt(num4) != "$"){eval("n"+num4+".style.left=flyofle-n"+num4+".offsetLeft+flyofwi/2");eval("n"+num4+".style.top=flyofto-n"+num4+".offsetTop+distance");eval("fly3('n"+num4+"',eval(n"+num4+".style.left.substring(0,n"+num4+ ".style.left.length-2)),(eval(n"+num4+".style.left.substring(0,n"+num4+".style.left.length-2))/5),eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2)),(eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2))/5))")};num4++;setTimeout("fly2b()",speed)}}
    function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2) != 0 && Math.floor(top2) != -1) || (Math.floor(lef2) != 0 && Math.floor(lef2) != -1)){if(eval("'"+lef2+"'").charAt(0) != '-'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2) != -1){eval(target+".style.visibility='visible';"+target+".style.left=Math.floor(lef2)")};else{eval(targ et+".style.visibility='visible';"+target+".style.left=Math.floor(lef2+1)")};if(eval("'"+lef2+"'").ch arAt(0) != '-'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2) != -1){eval(target+".style.top=Math.floor(top2)")};else{eval(target+".style.top=Math.floor(top2+1)")};se tTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50)}};

    stfly()

    </script>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •