xoxjesse143xox

Rainbow text

Jun 22nd, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <b>
  2.  
  3. <script>
  4.  
  5. /*
  6. RAINBOW TEXT Script by Matt Hedgecoe (c) 2002
  7. Featured on JavaScript Kit
  8. For this script, visit http://www.javascriptkit.com
  9. */
  10.  
  11. // ********** MAKE YOUR CHANGES HERE
  12.  
  13. var text="RAINBOW TEXT" // YOUR TEXT
  14. var speed=80 // SPEED OF FADE
  15.  
  16. // ********** LEAVE THE NEXT BIT ALONE!
  17.  
  18.  
  19. if (document.all||document.getElementById){
  20. document.write('<span id="highlight">' + text + '</span>')
  21. var storetext=document.getElementById? document.getElementById("highlight") : document.all.highlight
  22. }
  23. else
  24. document.write(text)
  25. var hex=new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
  26. var r=1
  27. var g=1
  28. var b=1
  29. var seq=1
  30. function changetext(){
  31. rainbow="#"+hex[r]+hex[g]+hex[b]
  32. storetext.style.color=rainbow
  33. }
  34. function change(){
  35. if (seq==6){
  36. b--
  37. if (b==0)
  38. seq=1
  39. }
  40. if (seq==5){
  41. r++
  42. if (r==12)
  43. seq=6
  44. }
  45. if (seq==4){
  46. g--
  47. if (g==0)
  48. seq=5
  49. }
  50. if (seq==3){
  51. b++
  52. if (b==12)
  53. seq=4
  54. }
  55. if (seq==2){
  56. r--
  57. if (r==0)
  58. seq=3
  59. }
  60. if (seq==1){
  61. g++
  62. if (g==12)
  63. seq=2
  64. }
  65. changetext()
  66. }
  67. function starteffect(){
  68. if (document.all||document.getElementById)
  69. flash=setInterval("change()",speed)
  70. }
  71. starteffect()
  72. </script>
  73. </b>
  74.  
  75. <p align="center">This free script provided by<br /><a href="http://javascriptkit.com">JavaScript Kit</a></p>
Advertisement
Add Comment
Please, Sign In to add comment