Martmists

Buttontest.html

Dec 29th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.17 KB | None | 0 0
  1. <!DOCTYPE xhtml>
  2. <html>
  3.     <head>
  4.         <title>
  5.             test
  6.         </title>
  7.         <style>
  8.             button{
  9.                 background-color: #000000;
  10.             }
  11.         </style>
  12.     </head>
  13.  
  14.     <body>
  15.         <button type="button">
  16.             <script>
  17.  
  18.  
  19. var text="&#9830 SAVE" //TEXT, also, using ✦ broke it.
  20. var speed=80 // SPEED OF FADE
  21.  
  22.  
  23. if (document.all||document.getElementById){
  24. document.write('<span id="highlight">' + text + '</span>')
  25. var storetext=document.getElementById? document.getElementById("highlight") : document.all.highlight
  26. }
  27. else
  28. document.write(text)
  29. var hex=new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
  30. var r=1
  31. var g=1
  32. var b=1
  33. var seq=1
  34. function changetext(){
  35. rainbow="#"+hex[r]+hex[g]+hex[b]
  36. storetext.style.color=rainbow
  37. }
  38. function change(){
  39. if (seq==6){
  40. b--
  41. if (b==0)
  42. seq=1
  43. }
  44. if (seq==5){
  45. r++
  46. if (r==12)
  47. seq=6
  48. }
  49. if (seq==4){
  50. g--
  51. if (g==0)
  52. seq=5
  53. }
  54. if (seq==3){
  55. b++
  56. if (b==12)
  57. seq=4
  58. }
  59. if (seq==2){
  60. r--
  61. if (r==0)
  62. seq=3
  63. }
  64. if (seq==1){
  65. g++
  66. if (g==12)
  67. seq=2
  68. }
  69. changetext()
  70. }
  71. function starteffect(){
  72. if (document.all||document.getElementById)
  73. flash=setInterval("change()",speed)
  74. }
  75. starteffect()
  76. </script>
  77. </button>
  78.     </body>
  79. </html>
Advertisement
Add Comment
Please, Sign In to add comment