SHARE
TWEET

Untitled

a guest Dec 16th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <body>
  2. <SCRIPT LANGUAGE="JavaScript">
  3. <!-- Begin
  4. var no = 50;
  5. var speed = 1;
  6. var ns4up = (document.layers) ? 1 : 0;
  7. var ie4up = (document.all) ? 1 : 0;
  8. var s, x, y, sn, cs;
  9. var a, r, cx, cy;
  10. var i, doc_width = 800, doc_height = 600;
  11. if (ns4up) {
  12. doc_width = self.innerWidth;
  13. doc_height = self.innerHeight;
  14. }
  15. else
  16. if (ie4up) {
  17. doc_width = document.body.clientWidth;
  18. doc_height = document.body.clientHeight;
  19. }
  20. x = new Array();
  21. y = new Array();
  22. r = new Array();
  23. cx = new Array();
  24. cy = new Array();
  25. s = 8;
  26. for (i = 0; i < no; ++ i) {
  27. initRain();
  28. if (ns4up) {
  29. if (i == 0) {
  30. document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
  31. document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
  32. document.write(",</font></layer>");
  33. }
  34. else {
  35. document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
  36. document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
  37. document.write(",</font></layer>");
  38.   }
  39. }
  40. else
  41. if (ie4up) {
  42. if (i == 0) {
  43. document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
  44. document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
  45. document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
  46. document.write(",</font></div>");
  47. }
  48. else {
  49. document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
  50. document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
  51. document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
  52. document.write(",</font></div>");
  53.      }
  54.   }
  55. }
  56. function initRain() {
  57. a = 6;
  58. r[i] = 1;
  59. sn = Math.sin(a);
  60. cs = Math.cos(a);
  61. cx[i] = Math.random() * doc_width + 1;
  62. cy[i] = Math.random() * doc_height + 1;
  63. x[i] = r[i] * sn + cx[i];
  64. y[i] = cy[i];
  65. }
  66. function makeRain() {
  67. r[i] = 1;
  68. cx[i] = Math.random() * doc_width + 1;
  69. cy[i] = 1;
  70. x[i] = r[i] * sn + cx[i];
  71. y[i] = r[i] * cs + cy[i];
  72. }
  73. function updateRain() {
  74. r[i] += s;
  75. x[i] = r[i] * sn + cx[i];
  76. y[i] = r[i] * cs + cy[i];
  77. }
  78. function raindropNS() {
  79. for (i = 0; i < no; ++ i) {
  80. updateRain();
  81. if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
  82. makeRain();
  83. doc_width = self.innerWidth;
  84. doc_height = self.innerHeight;
  85. }
  86. document.layers["dot"+i].top = y[i];
  87. document.layers["dot"+i].left = x[i];
  88. }
  89. setTimeout("raindropNS()", speed);
  90. }
  91. function raindropIE() {
  92. for (i = 0; i < no; ++ i) {
  93. updateRain();
  94. if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
  95. makeRain();
  96. doc_width = document.body.clientWidth;
  97. doc_height = document.body.clientHeight;
  98. }
  99. document.all["dot"+i].style.pixelTop = y[i];
  100. document.all["dot"+i].style.pixelLeft = x[i];
  101. }
  102. setTimeout("raindropIE()", speed);
  103. }
  104. if (ns4up) {
  105. raindropNS();
  106. }
  107. else
  108. if (ie4up) {
  109. raindropIE();
  110. }
  111. //  End -->
  112. </script>
  113. </body>
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