fork(1) download
  1. <DIV id=textrotator style="FONT: 16px arial bold; WIDTH: 100%; COLOR: rgb(255,255,255)"></DIV>
  2.  
  3. <script type = "text/javascript">
  4.  
  5. var hexinput = 255; // initial color value.
  6.  
  7. quotation = new Array()
  8. quotation[0] = "...The big brown fox jumped over the tall fence"
  9. quotation[1] = "...The wind is blowing cold snow across the dark black road"
  10. quotation[2] = "...Fall has many colors and black is not one of them"
  11. quotation[3] = "...the blue bird lives in the big red barn"
  12. quotation[4] = "...Mr. Grant really believes that the Bull’s skills, which are widespread"
  13. quotation[5] = "...Sixth quotation"
  14.  
  15. function fadingtext(){
  16. if(hexinput >0) {
  17. hexinput -=11; // increase color value
  18. document.getElementById("textrotator").style.color="rgb("+hexinput+","+hexinput+","+hexinput+")"; // Set color value.
  19. setTimeout("fadingtext()",200); // 200ms per step
  20. }
  21. else {
  22. hexinput = 255; //reset hex value
  23. }
  24. }
  25.  
  26. function changetext(){
  27. if(!document.getElementById){return}
  28.  
  29. var which = Math.round(Math.random()*(quotation.length - 1)); //select random quote
  30. document.getElementById("textrotator").innerHTML = quotation[which]; // and display it
  31.  
  32. fadingtext();
  33.  
  34. setTimeout("changetext()",5000); // five seconds
  35. }
  36.  
  37. window.onload = changetext();
  38.  
  39. </script>
Runtime error #stdin #stdout 0.01s 4980KB
stdin
Standard input is empty
stdout
Standard output is empty