SHARE
TWEET

Untitled

a guest Dec 16th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script language="JavaScript1.2">
  2. //configure message
  3. message="Welcome to www.javascriptfreecode.com"
  4. //animate text in NS6? (0 will turn it off)
  5. ns6switch=1
  6.  
  7. var ns6=document.getElementById&&!document.all
  8. mes=new Array();
  9. mes[0]=-1;
  10. mes[1]=-4;
  11. mes[2]=-7;mes[3]=-10;
  12. mes[4]=-7;
  13. mes[5]=-4;
  14. mes[6]=-1;
  15. num=0;
  16. num2=0;
  17. txt="";
  18. function jump0(){
  19. if (ns6&&!ns6switch){
  20. jump.innerHTML=message
  21. return
  22. }
  23. if(message.length > 6){
  24. for(i=0; i != message.length;i++){
  25. txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
  26. jump.innerHTML=txt;
  27. txt="";
  28. jump1a()
  29. }
  30. else{
  31. alert("Your message is to short")
  32. }
  33. }
  34.  
  35. function jump1a(){
  36. nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
  37. nfinal.style.left=-num2;
  38. if(num2 != 9){
  39. num2=num2+3;
  40. setTimeout("jump1a()",50)
  41. }
  42. else{
  43. jump1b()
  44. }
  45. }
  46.  
  47. function jump1b(){
  48. nfinal.style.left=-num2;
  49. if(num2 != 0){num2=num2-3;
  50. setTimeout("jump1b()",50)
  51. }
  52. else{
  53. jump2()
  54. }
  55. }
  56.  
  57. function jump2(){
  58. txt="";
  59. for(i=0;i != message.length;i++){
  60. if(i+num > -1 && i+num < 7){
  61. txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
  62. }
  63. else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
  64. }
  65. jump.innerHTML=txt;
  66. txt="";
  67. if(num != (-message.length)){
  68. num--;
  69. setTimeout("jump2()",50)}
  70. else{num=0;
  71. setTimeout("jump0()",50)}}
  72. </script>
  73. </head>
  74. <body>
  75.  
  76. <h2><div id="jumpx" style="color:green"></div></h2>
  77. <script>
  78. if (document.all||document.getElementById){
  79. jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx
  80. jump0()
  81. }
  82. else
  83. document.write(message)
  84. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top